Image encoding/decoding method and device using weighted prediction, and method for transmitting bitstream

ABSTRACT

An image encoding/decoding method and apparatus are provided. An image decoding method performed by an image decoding apparatus may comprise parsing weight information specifying a weight for a reference sample from a bitstream according to a weight parameter syntax structure, and decoding a current block by performing inter prediction based on the weight information. The parsing according to the weight parameter syntax structure may comprise obtaining weight number information specifying the number of weight information obtained from the bitstream according to the weight parameter syntax structure and obtaining weight information from the weight parameter syntax structure based on the weight number information.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. Patent Application No.17/695,383, filed on Mar. 15, 2023, which is a Bypass Continuation ofInternational Application No. PCT/KR2020/012495, filed on Sep. 16, 2020,which claims the benefit of U.S. Provisional Application No. 62/901,243,filed on Sep. 16, 2019, the contents of which are all herebyincorporated by reference herein in their entirety.

TECHNICAL FIELD

The present disclosure relates to an image encoding/decoding method andapparatus, and, more particularly, to an image encoding/decoding methodand apparatus using weighted prediction, and a method of transmitting abitstream generated by the image encoding method/apparatus of thepresent disclosure.

BACKGROUND ART

Recently, demand for high-resolution and high-quality images such ashigh definition (HD) images and ultra high definition (UHD) images isincreasing in various fields. As resolution and quality of image dataare improved, the amount of transmitted information or bits relativelyincreases as compared to existing image data. An increase in the amountof transmitted information or bits causes an increase in transmissioncost and storage cost.

Accordingly, there is a need for high-efficient image compressiontechnology for effectively transmitting, storing and reproducinginformation on high-resolution and high-quality images.

DISCLOSURE Technical Problem

An object of the present disclosure is to provide an imageencoding/decoding method and apparatus with improved encoding/decodingefficiency.

Another object of the present disclosure is to provide an imageencoding/decoding method and apparatus capable of improvingencoding/decoding efficiency by efficiently signaling syntax elementsrelated to weighted prediction.

Another object of the present disclosure is to provide a method oftransmitting a bitstream generated by an image encoding method orapparatus according to the present disclosure.

Another object of the present disclosure is to provide a recordingmedium storing a bitstream generated by an image encoding method orapparatus according to the present disclosure.

Another object of the present disclosure is to provide a recordingmedium storing a bitstream received, decoded and used to reconstruct animage by an image decoding apparatus according to the presentdisclosure.

The technical problems solved by the present disclosure are not limitedto the above technical problems and other technical problems which arenot described herein will become apparent to those skilled in the artfrom the following description.

Technical Solution

An image decoding method performed by an image decoding apparatusaccording to an aspect of the present disclosure may comprise parsingweight information specifying a weight for a reference sample from abitstream according to a weight parameter syntax structure, and decodinga current block by performing inter prediction based on the weightinformation.

The parsing according to the weight parameter syntax structure maycomprise obtaining weight number information specifying the number ofweight information obtained from the bitstream according to the weightparameter syntax structure and obtaining weight information from theweight parameter syntax structure based on the weight numberinformation.

An image decoding apparatus according to an aspect of the presentdisclosure may comprise a memory and at least one processor. The atleast one processor may parse weight information specifying a weight fora reference sample from a bitstream according to a weight parametersyntax structure and decode a current block by performing interprediction based on the weight information. Furthermore, the processormay perform parsing according to the weight parameter syntax structure,by obtaining weight number information specifying the number of weightinformation obtained from the bitstream according to the weightparameter syntax structure and obtaining weight information from theweight parameter syntax structure based on the weight numberinformation.

An image encoding method performed by an image encoding apparatusaccording to an aspect of the present disclosure may comprise generatinga prediction block of a current block by performing inter prediction,generating weight information specifying a weight for a sampleconstructing the prediction block, determining weight number informationspecifying the number of weight information, and generating a bitstreamincluding the weight number information and the weight information basedon a weight parameter syntax structure.

In addition, a transmission method according to another aspect of thepresent disclosure may transmit a bitstream generated by the imageencoding apparatus or the image encoding method of the presentdisclosure.

In addition, a computer-readable recording medium according to anotheraspect of the present disclosure may store the bitstream generated bythe image encoding apparatus or the image encoding method of the presentdisclosure.

The features briefly summarized above with respect to the presentdisclosure are merely exemplary aspects of the detailed descriptionbelow of the present disclosure, and do not limit the scope of thepresent disclosure.

Advantageous Effects

According to the present disclosure, it is possible to provide an imageencoding/decoding method and apparatus with improved encoding/decodingefficiency.

Also, according to the present disclosure, it is possible to provide animage encoding/decoding method and apparatus capable of improvingencoding/decoding efficiency by efficiently signaling syntax elementsrelated to weighted prediction.

Also, according to the present disclosure, it is possible to provide amethod of transmitting a bitstream generated by an image encoding methodor apparatus according to the present disclosure.

Also, according to the present disclosure, it is possible to provide arecording medium storing a bitstream generated by an image encodingmethod or apparatus according to the present disclosure.

Also, according to the present disclosure, it is possible to provide arecording medium storing a bitstream received, decoded and used toreconstruct an image by an image decoding apparatus according to thepresent disclosure.

It will be appreciated by persons skilled in the art that that theeffects that can be achieved through the present disclosure are notlimited to what has been particularly described hereinabove and otheradvantages of the present disclosure will be more clearly understoodfrom the detailed description.

Description of Drawings

FIG. 1 is a view schematically showing a video coding system, to whichan embodiment of the present disclosure is applicable.

FIG. 2 is a view schematically showing an image encoding apparatus, towhich an embodiment of the present disclosure is applicable.

FIG. 3 is a view schematically showing an image decoding apparatus, towhich an embodiment of the present disclosure is applicable.

FIG. 4 is a view showing a partitioning structure of an image accordingto an embodiment.

FIG. 5 is a view showing an embodiment of a partitioning type of a blockaccording to a multi-type tree structure.

FIG. 6 is a view showing a signaling mechanism of block splittinginformation in a quadtree with nested multi-type tree structureaccording to the present disclosure.

FIG. 7 is a view showing an embodiment in which a CTU is partitionedinto multiple CUs.

FIG. 8 is a block diagram of CABAC according to an embodiment forencoding one syntax element.

FIGS. 9 to 12 are views illustrating entropy encoding and decodingaccording to an embodiment.

FIGS. 13 and 14 are views illustrating examples of a picture decodingand encoding procedure according to an embodiment.

FIG. 15 is a view illustrating a layer structure for a coded imageaccording to an embodiment.

FIG. 16 is a view illustrating an encoding method using inter predictionaccording to an embodiment.

FIG. 17 is a view illustrating a decoding method using inter predictionaccording to an embodiment.

FIG. 18 is a view illustrating a weighted prediction process accordingto an embodiment.

FIG. 19 is a view illustrating syntax for two syntax elements signaledin an SPS according to an embodiment.

FIG. 20 is a view illustrating a weighted prediction syntax elementsignaled in a PPS according to an embodiment.

FIG. 21 is a view illustrating a weighted prediction syntax elementsignaled in a slice header according to an embodiment.

FIG. 22 is a view illustrating an algorithm according to an embodimentfor deriving a value of a variable NumRefIdxActive[i].

FIG. 23 is a view illustrating weighted prediction table syntax calledfrom a slice header according to an embodiment.

FIG. 24 is a view illustrating syntax in which a prediction weightedtable is signaled in an APS RBSP according to an embodiment.

FIG. 25 is a view illustrating syntax according to an embodiment of amodified slice header.

FIG. 26 is a view illustrating a prediction weighted table syntaxstructure according to an embodiment.

FIGS. 27 to 28 are views illustrating operation of a decoding apparatusand an encoding apparatus according to an embodiment.

FIG. 29 is a view showing a content streaming system, to which anembodiment of the present disclosure is applicable.

MODE FOR INVENTION

Hereinafter, the embodiments of the present disclosure will be describedin detail with reference to the accompanying drawings so as to be easilyimplemented by those skilled in the art. However, the present disclosuremay be implemented in various different forms, and is not limited to theembodiments described herein.

In describing the present disclosure, if it is determined that thedetailed description of a related known function or construction rendersthe scope of the present disclosure unnecessarily ambiguous, thedetailed description thereof will be omitted. In the drawings, parts notrelated to the description of the present disclosure are omitted, andsimilar reference numerals are attached to similar parts.

In the present disclosure, when a component is “connected”, “coupled” or“linked” to another component, it may include not only a directconnection relationship but also an indirect connection relationship inwhich an intervening component is present. In addition, when a component“includes” or “has” other components, it means that other components maybe further included, rather than excluding other components unlessotherwise stated.

In the present disclosure, the terms first, second, etc. may be usedonly for the purpose of distinguishing one component from othercomponents, and do not limit the order or importance of the componentsunless otherwise stated. Accordingly, within the scope of the presentdisclosure, a first component in one embodiment may be referred to as asecond component in another embodiment, and similarly, a secondcomponent in one embodiment may be referred to as a first component inanother embodiment.

In the present disclosure, components that are distinguished from eachother are intended to clearly describe each feature, and do not meanthat the components are necessarily separated. That is, a plurality ofcomponents may be integrated and implemented in one hardware or softwareunit, or one component may be distributed and implemented in a pluralityof hardware or software units. Therefore, even if not stated otherwise,such embodiments in which the components are integrated or the componentis distributed are also included in the scope of the present disclosure.

In the present disclosure, the components described in variousembodiments do not necessarily mean essential components, and somecomponents may be optional components. Accordingly, an embodimentconsisting of a subset of components described in an embodiment is alsoincluded in the scope of the present disclosure. In addition,embodiments including other components in addition to componentsdescribed in the various embodiments are included in the scope of thepresent disclosure.

The present disclosure relates to encoding and decoding of an image, andterms used in the present disclosure may have a general meaning commonlyused in the technical field, to which the present disclosure belongs,unless newly defined in the present disclosure.

In the present disclosure, a “picture” generally refers to a unitrepresenting one image in a specific time period, and a slice/tile is acoding unit constituting a part of a picture, and one picture may becomposed of one or more slices/tiles. In addition, a slice/tile mayinclude one or more coding tree units (CTUs). Meanwhile, one tile mayinclude one or more bricks. The brick may refer to a rectangular area ofCTU rows in a tile. One tile may be split into a plurality of bricks,and each brick may include one or more CTU rows belonging to a tile.

In the present disclosure, a “pixel” or a “pel” may mean a smallest unitconstituting one picture (or image). In addition, “sample” may be usedas a term corresponding to a pixel. A sample may generally represent apixel or a value of a pixel, and may represent only a pixel/pixel valueof a luma component or only a pixel/pixel value of a chroma component.

In the present disclosure, a “unit” may represent a basic unit of imageprocessing. The unit may include at least one of a specific region ofthe picture and information related to the region. The unit may be usedinterchangeably with terms such as “sample array”, “block” or “area” insome cases. In a general case, an M×N block may include samples (orsample arrays) or a set (or array) of transform coefficients of Mcolumns and N rows.

In the present disclosure, “current block” may mean one of “currentcoding block”, “current coding unit”, “coding target block”, “decodingtarget block” or “processing target block”. When prediction isperformed, “current block” may mean “current prediction block” or“prediction target block”. When transform (inversetransform)/quantization (dequantization) is performed, “current block”may mean “current transform block” or “transform target block”. Whenfiltering is performed, “current block” may mean “filtering targetblock”.

In addition, in the present disclosure, a “current block” may mean “aluma block of a current block” unless explicitly stated as a chromablock. The “chroma block of the current block” may be expressed byincluding an explicit description of a chroma block, such as “chromablock” or “current chroma block”.

In the present disclosure, the term “/” and “,” should be interpreted toindicate “and/or.” For instance, the expression “A/B” and “A, B” maymean “A and/or B.” Further, “A/B/C” and “A/B/C” may mean “at least oneof A, B, and/or C.”

In the present disclosure, the term “or” should be interpreted toindicate “and/or.” For instance, the expression “A or B” may comprise 1)only “A”, 2) only “B”, and/or 3) both “A and B”. In other words, in thepresent disclosure, the term “or” should be interpreted to indicate“additionally or alternatively.”

Overview of Video Coding System

FIG. 1 is a view showing a video coding system according to the presentdisclosure.

The video coding system according to an embodiment may include aencoding apparatus 10 and a decoding apparatus 20. The encodingapparatus 10 may deliver encoded video and/or image information or datato the decoding apparatus 20 in the form of a file or streaming via adigital storage medium or network.

The encoding apparatus 10 according to an embodiment may include a videosource generator 11, an encoding unit 12 and a transmitter 13. Thedecoding apparatus 20 according to an embodiment may include a receiver21, a decoding unit 22 and a renderer 23. The encoding unit 12 may becalled a video/image encoding unit, and the decoding unit 22 may becalled a video/image decoding unit. The transmitter 13 may be includedin the encoding unit 12. The receiver 21 may be included in the decodingunit 22. The renderer 23 may include a display and the display may beconfigured as a separate device or an external component.

The video source generator 11 may acquire a video/image through aprocess of capturing, synthesizing or generating the video/image. Thevideo source generator 11 may include a video/image capture deviceand/or a video/image generating device. The video/image capture devicemay include, for example, one or more cameras, video/image archivesincluding previously captured video/images, and the like. Thevideo/image generating device may include, for example, computers,tablets and smartphones, and may (electronically) generate video/images.For example, a virtual video/image may be generated through a computeror the like. In this case, the video/image capturing process may bereplaced by a process of generating related data.

The encoding unit 12 may encode an input video/image. The encoding unit12 may perform a series of procedures such as prediction, transform, andquantization for compression and coding efficiency. The encoding unit 12may output encoded data (encoded video/image information) in the form ofa bitstream.

The transmitter 13 may transmit the encoded video/image information ordata output in the form of a bitstream to the receiver 21 of thedecoding apparatus 20 through a digital storage medium or a network inthe form of a file or streaming. The digital storage medium may includevarious storage mediums such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, andthe like. The transmitter 13 may include an element for generating amedia file through a predetermined file format and may include anelement for transmission through a broadcast/communication network. Thereceiver 21 may extract/receive the bitstream from the storage medium ornetwork and transmit the bitstream to the decoding unit 22.

The decoding unit 22 may decode the video/image by performing a seriesof procedures such as dequantization, inverse transform, and predictioncorresponding to the operation of the encoding unit 12.

The renderer 23 may render the decoded video/image. The renderedvideo/image may be displayed through the display.

Overview of Image Encoding Apparatus

FIG. 2 is a view schematically showing an image encoding apparatus, towhich an embodiment of the present disclosure is applicable.

As shown in FIG. 2 , the image encoding apparatus 100 may include animage partitioner 110, a subtractor 115, a transformer 120, a quantizer130, a dequantizer 140, an inverse transformer 150, an adder 155, afilter 160, a memory 170, an inter prediction unit 180, an intraprediction unit 185 and an entropy encoder 190. The inter predictionunit 180 and the intra prediction unit 185 may be collectively referredto as a “prediction unit”. The transformer 120, the quantizer 130, thedequantizer 140 and the inverse transformer 150 may be included in aresidual processor. The residual processor may further include thesubtractor 115.

All or at least some of the plurality of components configuring theimage encoding apparatus 100 may be configured by one hardware component(e.g., an encoder or a processor) in some embodiments. In addition, thememory 170 may include a decoded picture buffer (DPB) and may beconfigured by a digital storage medium.

The image partitioner 110 may partition an input image (or a picture ora frame) input to the image encoding apparatus 100 into one or moreprocessing units. For example, the processing unit may be called acoding unit (CU). The coding unit may be acquired by recursivelypartitioning a coding tree unit (CTU) or a largest coding unit (LCU)according to a quad-tree binary-tree ternary-tree (QT/BT/TT) structure.For example, one coding unit may be partitioned into a plurality ofcoding units of a deeper depth based on a quad tree structure, a binarytree structure, and/or a ternary structure. For partitioning of thecoding unit, a quad tree structure may be applied first and the binarytree structure and/or ternary structure may be applied later. The codingprocedure according to the present disclosure may be performed based onthe final coding unit that is no longer partitioned. The largest codingunit may be used as the final coding unit or the coding unit of deeperdepth acquired by partitioning the largest coding unit may be used asthe final coding unit. Here, the coding procedure may include aprocedure of prediction, transform, and reconstruction, which will bedescribed later. As another example, the processing unit of the codingprocedure may be a prediction unit (PU) or a transform unit (TU). Theprediction unit and the transform unit may be split or partitioned fromthe final coding unit. The prediction unit may be a unit of sampleprediction, and the transform unit may be a unit for deriving atransform coefficient and/or a unit for deriving a residual signal fromthe transform coefficient.

The prediction unit (the inter prediction unit 180 or the intraprediction unit 185) may perform prediction on a block to be processed(current block) and generate a predicted block including predictionsamples for the current block. The prediction unit may determine whetherintra prediction or inter prediction is applied on a current block or CUbasis. The prediction unit may generate various information related toprediction of the current block and transmit the generated informationto the entropy encoder 190. The information on the prediction may beencoded in the entropy encoder 190 and output in the form of abitstream.

The intra prediction unit 185 may predict the current block by referringto the samples in the current picture. The referred samples may belocated in the neighborhood of the current block or may be located apartaccording to the intra prediction mode and/or the intra predictiontechnique. The intra prediction modes may include a plurality ofnon-directional modes and a plurality of directional modes. Thenon-directional mode may include, for example, a DC mode and a planarmode. The directional mode may include, for example, 33 directionalprediction modes or 65 directional prediction modes according to thedegree of detail of the prediction direction. However, this is merely anexample, more or less directional prediction modes may be used dependingon a setting. The intra prediction unit 185 may determine the predictionmode applied to the current block by using a prediction mode applied toa neighboring block.

The inter prediction unit 180 may derive a predicted block for thecurrent block based on a reference block (reference sample array)specified by a motion vector on a reference picture. In this case, inorder to reduce the amount of motion information transmitted in theinter prediction mode, the motion information may be predicted in unitsof blocks, subblocks, or samples based on correlation of motioninformation between the neighboring block and the current block. Themotion information may include a motion vector and a reference pictureindex. The motion information may further include inter predictiondirection (L0 prediction, L1 prediction, Bi prediction, etc.)information. In the case of inter prediction, the neighboring block mayinclude a spatial neighboring block present in the current picture and atemporal neighboring block present in the reference picture. Thereference picture including the reference block and the referencepicture including the temporal neighboring block may be the same ordifferent. The temporal neighboring block may be called a collocatedreference block, a co-located CU (colCU), and the like. The referencepicture including the temporal neighboring block may be called acollocated picture (colPic). For example, the inter prediction unit 180may configure a motion information candidate list based on neighboringblocks and generate information specifying which candidate is used toderive a motion vector and/or a reference picture index of the currentblock. Inter prediction may be performed based on various predictionmodes. For example, in the case of a skip mode and a merge mode, theinter prediction unit 180 may use motion information of the neighboringblock as motion information of the current block. In the case of theskip mode, unlike the merge mode, the residual signal may not betransmitted. In the case of the motion vector prediction (MVP) mode, themotion vector of the neighboring block may be used as a motion vectorpredictor, and the motion vector of the current block may be signaled byencoding a motion vector difference and an indicator for a motion vectorpredictor. The motion vector difference may mean a difference betweenthe motion vector of the current block and the motion vector predictor.

The prediction unit may generate a prediction signal based on variousprediction methods and prediction techniques described below. Forexample, the prediction unit may not only apply intra prediction orinter prediction but also simultaneously apply both intra prediction andinter prediction, in order to predict the current block. A predictionmethod of simultaneously applying both intra prediction and interprediction for prediction of the current block may be called combinedinter and intra prediction (CIIP). In addition, the prediction unit mayperform intra block copy (IBC) for prediction of the current block.Intra block copy may be used for content image/video coding of a game orthe like, for example, screen content coding (SCC). IBC is a method ofpredicting a current picture using a previously reconstructed referenceblock in the current picture at a location apart from the current blockby a predetermined distance. When IBC is applied, the location of thereference block in the current picture may be encoded as a vector (blockvector) corresponding to the predetermined distance. IBC basicallyperforms prediction in the current picture, but may be performedsimilarly to inter prediction in that a reference block is derivedwithin the current picture. That is, IBC may use at least one of theinter prediction techniques described in the present disclosure.

The prediction signal generated by the prediction unit may be used togenerate a reconstructed signal or to generate a residual signal. Thesubtractor 115 may generate a residual signal (residual block orresidual sample array) by subtracting the prediction signal (predictedblock or prediction sample array) output from the prediction unit fromthe input image signal (original block or original sample array). Thegenerated residual signal may be transmitted to the transformer 120.

The transformer 120 may generate transform coefficients by applying atransform technique to the residual signal. For example, the transformtechnique may include at least one of a discrete cosine transform (DCT),a discrete sine transform (DST), a karhunen-loève transform (KLT), agraph-based transform (GBT), or a conditionally non-linear transform(CNT). Here, the GBT means transform obtained from a graph whenrelationship information between pixels is represented by the graph. TheCNT refers to transform acquired based on a prediction signal generatedusing all previously reconstructed pixels. In addition, the transformprocess may be applied to square pixel blocks having the same size ormay be applied to blocks having a variable size rather than square.

The quantizer 130 may quantize the transform coefficients and transmitthem to the entropy encoder 190. The entropy encoder 190 may encode thequantized signal (information on the quantized transform coefficients)and output a bitstream. The information on the quantized transformcoefficients may be referred to as residual information. The quantizer130 may rearrange quantized transform coefficients in a block form intoa one-dimensional vector form based on a coefficient scanning order andgenerate information on the quantized transform coefficients based onthe quantized transform coefficients in the one-dimensional vector form.

The entropy encoder 190 may perform various encoding methods such as,for example, exponential Golomb, context-adaptive variable length coding(CAVLC), context-adaptive binary arithmetic coding (CABAC), and thelike. The entropy encoder 190 may encode information necessary forvideo/image reconstruction other than quantized transform coefficients(e.g., values of syntax elements, etc.) together or separately. Encodedinformation (e.g., encoded video/image information) may be transmittedor stored in units of network abstraction layers (NALs) in the form of abitstream. The video/image information may further include informationon various parameter sets such as an adaptation parameter set (APS), apicture parameter set (PPS), a sequence parameter set (SPS), or a videoparameter set (VPS). In addition, the video/image information mayfurther include general constraint information. The signaledinformation, transmitted information and/or syntax elements described inthe present disclosure may be encoded through the above-describedencoding procedure and included in the bitstream.

The bitstream may be transmitted over a network or may be stored in adigital storage medium. The network may include a broadcasting networkand/or a communication network, and the digital storage medium mayinclude various storage media such as USB, SD, CD, DVD, Blu-ray, HDD,SSD, and the like. A transmitter (not shown) transmitting a signaloutput from the entropy encoder 190 and/or a storage unit (not shown)storing the signal may be included as internal/external element of theimage encoding apparatus 100. Alternatively, the transmitter may beprovided as the component of the entropy encoder 190.

The quantized transform coefficients output from the quantizer 130 maybe used to generate a residual signal. For example, the residual signal(residual block or residual samples) may be reconstructed by applyingdequantization and inverse transform to the quantized transformcoefficients through the dequantizer 140 and the inverse transformer150.

The adder 155 adds the reconstructed residual signal to the predictionsignal output from the inter prediction unit 180 or the intra predictionunit 185 to generate a reconstructed signal (reconstructed picture,reconstructed block, reconstructed sample array). If there is noresidual for the block to be processed, such as a case where the skipmode is applied, the predicted block may be used as the reconstructedblock. The adder 155 may be called a reconstructor or a reconstructedblock generator. The generated reconstructed signal may be used forintra prediction of a next block to be processed in the current pictureand may be used for inter prediction of a next picture through filteringas described below.

The filter 160 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter160 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture and store the modifiedreconstructed picture in the memory 170, specifically, a DPB of thememory 170. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like. The filter 160 may generate variousinformation related to filtering and transmit the generated informationto the entropy encoder 190 as described later in the description of eachfiltering method. The information related to filtering may be encoded bythe entropy encoder 190 and output in the form of a bitstream.

The modified reconstructed picture transmitted to the memory 170 may beused as the reference picture in the inter prediction unit 180. Wheninter prediction is applied through the image encoding apparatus 100,prediction mismatch between the image encoding apparatus 100 and theimage decoding apparatus may be avoided and encoding efficiency may beimproved.

The DPB of the memory 170 may store the modified reconstructed picturefor use as a reference picture in the inter prediction unit 180. Thememory 170 may store the motion information of the block from which themotion information in the current picture is derived (or encoded) and/orthe motion information of the blocks in the picture that have alreadybeen reconstructed. The stored motion information may be transmitted tothe inter prediction unit 180 and used as the motion information of thespatial neighboring block or the motion information of the temporalneighboring block. The memory 170 may store reconstructed samples ofreconstructed blocks in the current picture and may transfer thereconstructed samples to the intra prediction unit 185.

Overview of Image Decoding Apparatus

FIG. 3 is a view schematically showing an image decoding apparatus, towhich an embodiment of the present disclosure is applicable.

As shown in FIG. 3 , the image decoding apparatus 200 may include anentropy decoder 210, a dequantizer 220, an inverse transformer 230, anadder 235, a filter 240, a memory 250, an inter prediction unit 260 andan intra prediction unit 265. The inter prediction unit 260 and theintra prediction unit 265 may be collectively referred to as a“prediction unit”. The dequantizer 220 and the inverse transformer 230may be included in a residual processor.

All or at least some of a plurality of components configuring the imagedecoding apparatus 200 may be configured by a hardware component (e.g.,a decoder or a processor) according to an embodiment. In addition, thememory 250 may include a decoded picture buffer (DPB) or may beconfigured by a digital storage medium.

The image decoding apparatus 200, which has received a bitstreamincluding video/image information, may reconstruct an image byperforming a process corresponding to a process performed by the imageencoding apparatus 100 of FIG. 2 . For example, the image decodingapparatus 200 may perform decoding using a processing unit applied inthe image encoding apparatus. Thus, the processing unit of decoding maybe a coding unit, for example. The coding unit may be acquired bypartitioning a coding tree unit or a largest coding unit. Thereconstructed image signal decoded and output through the image decodingapparatus 200 may be reproduced through a reproducing apparatus (notshown).

The image decoding apparatus 200 may receive a signal output from theimage encoding apparatus of FIG. 2 in the form of a bitstream. Thereceived signal may be decoded through the entropy decoder 210. Forexample, the entropy decoder 210 may parse the bitstream to deriveinformation (e.g., video/image information) necessary for imagereconstruction (or picture reconstruction). The video/image informationmay further include information on various parameter sets such as anadaptation parameter set (APS), a picture parameter set (PPS), asequence parameter set (SPS), or a video parameter set (VPS). Inaddition, the video/image information may further include generalconstraint information. The image decoding apparatus may further decodepicture based on the information on the parameter set and/or the generalconstraint information. Signaled/received information and/or syntaxelements described in the present disclosure may be decoded through thedecoding procedure and obtained from the bitstream. For example, theentropy decoder 210 decodes the information in the bitstream based on acoding method such as exponential Golomb coding, CAVLC, or CABAC, andoutput values of syntax elements required for image reconstruction andquantized values of transform coefficients for residual. Morespecifically, the CABAC entropy decoding method may receive a bincorresponding to each syntax element in the bitstream, determine acontext model using a decoding target syntax element information,decoding information of a neighboring block and a decoding target blockor information of a symbol/bin decoded in a previous stage, and performarithmetic decoding on the bin by predicting a probability of occurrenceof a bin according to the determined context model, and generate asymbol corresponding to the value of each syntax element. In this case,the CABAC entropy decoding method may update the context model by usingthe information of the decoded symbol/bin for a context model of a nextsymbol/bin after determining the context model. The information relatedto the prediction among the information decoded by the entropy decoder210 may be provided to the prediction unit (the inter prediction unit260 and the intra prediction unit 265), and the residual value on whichthe entropy decoding was performed in the entropy decoder 210, that is,the quantized transform coefficients and related parameter information,may be input to the dequantizer 220. In addition, information onfiltering among information decoded by the entropy decoder 210 may beprovided to the filter 240. Meanwhile, a receiver (not shown) forreceiving a signal output from the image encoding apparatus may befurther configured as an internal/external element of the image decodingapparatus 200, or the receiver may be a component of the entropy decoder210.

Meanwhile, the image decoding apparatus according to the presentdisclosure may be referred to as a video/image/picture decodingapparatus. The image decoding apparatus may be classified into aninformation decoder (video/image/picture information decoder) and asample decoder (video/image/picture sample decoder). The informationdecoder may include the entropy decoder 210. The sample decoder mayinclude at least one of the dequantizer 220, the inverse transformer230, the adder 235, the filter 240, the memory 250, the inter predictionunit 260 or the intra prediction unit 265.

The dequantizer 220 may dequantize the quantized transform coefficientsand output the transform coefficients. The dequantizer 220 may rearrangethe quantized transform coefficients in the form of a two-dimensionalblock. In this case, the rearrangement may be performed based on thecoefficient scanning order performed in the image encoding apparatus.The dequantizer 220 may perform dequantization on the quantizedtransform coefficients by using a quantization parameter (e.g.,quantization step size information) and obtain transform coefficients.

The inverse transformer 230 may inversely transform the transformcoefficients to obtain a residual signal (residual block, residualsample array).

The prediction unit may perform prediction on the current block andgenerate a predicted block including prediction samples for the currentblock. The prediction unit may determine whether intra prediction orinter prediction is applied to the current block based on theinformation on the prediction output from the entropy decoder 210 andmay determine a specific intra/inter prediction mode (predictiontechnique).

It is the same as described in the prediction unit of the image encodingapparatus 100 that the prediction unit may generate the predictionsignal based on various prediction methods (techniques) which will bedescribed later.

The intra prediction unit 265 may predict the current block by referringto the samples in the current picture. The description of the intraprediction unit 185 is equally applied to the intra prediction unit 265.

The inter prediction unit 260 may derive a predicted block for thecurrent block based on a reference block (reference sample array)specified by a motion vector on a reference picture. In this case, inorder to reduce the amount of motion information transmitted in theinter prediction mode, motion information may be predicted in units ofblocks, subblocks, or samples based on correlation of motion informationbetween the neighboring block and the current block. The motioninformation may include a motion vector and a reference picture index.The motion information may further include inter prediction direction(L0 prediction, L1 prediction, Bi prediction, etc.) information. In thecase of inter prediction, the neighboring block may include a spatialneighboring block present in the current picture and a temporalneighboring block present in the reference picture. For example, theinter prediction unit 260 may configure a motion information candidatelist based on neighboring blocks and derive a motion vector of thecurrent block and/or a reference picture index based on the receivedcandidate selection information. Inter prediction may be performed basedon various prediction modes, and the information on the prediction mayinclude information specifying a mode of inter prediction for thecurrent block.

The adder 235 may generate a reconstructed signal (reconstructedpicture, reconstructed block, reconstructed sample array) by adding theobtained residual signal to the prediction signal (predicted block,predicted sample array) output from the prediction unit (including theinter prediction unit 260 and/or the intra prediction unit 265). Ifthere is no residual for the block to be processed, such as when theskip mode is applied, the predicted block may be used as thereconstructed block. The description of the adder 155 is equallyapplicable to the adder 235. The adder 235 may be called a reconstructoror a reconstructed block generator. The generated reconstructed signalmay be used for intra prediction of a next block to be processed in thecurrent picture and may be used for inter prediction of a next picturethrough filtering as described below.

The filter 240 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter240 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture and store the modifiedreconstructed picture in the memory 250, specifically, a DPB of thememory 250. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like.

The (modified) reconstructed picture stored in the DPB of the memory 250may be used as a reference picture in the inter prediction unit 260. Thememory 250 may store the motion information of the block from which themotion information in the current picture is derived (or decoded) and/orthe motion information of the blocks in the picture that have alreadybeen reconstructed. The stored motion information may be transmitted tothe inter prediction unit 260 so as to be utilized as the motioninformation of the spatial neighboring block or the motion informationof the temporal neighboring block. The memory 250 may storereconstructed samples of reconstructed blocks in the current picture andtransfer the reconstructed samples to the intra prediction unit 265.

In the present disclosure, the embodiments described in the filter 160,the inter prediction unit 180, and the intra prediction unit 185 of theimage encoding apparatus 100 may be equally or correspondingly appliedto the filter 240, the inter prediction unit 260, and the intraprediction unit 265 of the image decoding apparatus 200.

Overview of Image Partitioning

The video/image coding method according to the present disclosure may beperformed based on an image partitioning structure as follows.Specifically, the procedures of prediction, residual processing((inverse) transform, (de)quantization, etc.), syntax element coding,and filtering, which will be described later, may be performed based ona CTU, CU (and/or TU, PU) derived based on the image partitioningstructure. The image may be partitioned in block units and the blockpartitioning procedure may be performed in the image partitioner 110 ofthe encoding apparatus. The partitioning related information may beencoded by the entropy encoder 190 and transmitted to the decodingapparatus in the form of a bitstream. The entropy decoder 210 of thedecoding apparatus may derive a block partitioning structure of thecurrent picture based on the partitioning related information obtainedfrom the bitstream, and based on this, may perform a series ofprocedures (e.g., prediction, residual processing, block/picturereconstruction, in-loop filtering, etc.) for image decoding.

Pictures may be partitioned into a sequence of coding tree units (CTUs).FIG. 4 shows an example in which a picture is partitioned into CTUs. TheCTU may correspond to a coding tree block (CTB). Alternatively, the CTUmay include a coding tree block of luma samples and two coding treeblocks of corresponding chroma samples. For example, for a picture thatcontains three sample arrays, the CTU may include an N×N block of lumasamples and two corresponding blocks of chroma samples.

Overview of Partitioning of CTU

As described above, the coding unit may be acquired by recursivelypartitioning the coding tree unit (CTU) or the largest coding unit (LCU)according to a quad-tree/binary-tree/ternary-tree (QT/BT/TT) structure.For example, the CTU may be first partitioned into quadtree structures.Thereafter, leaf nodes of the quadtree structure may be furtherpartitioned by a multi-type tree structure.

Partitioning according to quadtree means that a current CU (or CTU) ispartitioned into equally four. By partitioning according to quadtree,the current CU may be partitioned into four CUs having the same widthand the same height. When the current CU is no longer partitioned intothe quadtree structure, the current CU corresponds to the leaf node ofthe quad-tree structure. The CU corresponding to the leaf node of thequadtree structure may be no longer partitioned and may be used as theabove-described final coding unit. Alternatively, the CU correspondingto the leaf node of the quadtree structure may be further partitioned bya multi-type tree structure.

FIG. 5 is a view showing an embodiment of a partitioning type of a blockaccording to a multi-type tree structure. Partitioning according to themulti-type tree structure may include two types of splitting accordingto a binary tree structure and two types of splitting according to aternary tree structure.

The two types of splitting according to the binary tree structure mayinclude vertical binary splitting (SPLIT_BT_VER) and horizontal binarysplitting (SPLIT_BT_HOR). Vertical binary splitting (SPLIT_BT_VER) meansthat the current CU is split into equally two in the vertical direction.As shown in FIG. 4 , by vertical binary splitting, two CUs having thesame height as the current CU and having a width which is half the widthof the current CU may be generated. Horizontal binary splitting(SPLIT_BT_HOR) means that the current CU is split into equally two inthe horizontal direction. As shown in FIG. 5 , by horizontal binarysplitting, two CUs having a height which is half the height of thecurrent CU and having the same width as the current CU may be generated.

Two types of splitting according to the ternary tree structure mayinclude vertical ternary splitting (SPLIT_TT_VER) and horizontal ternarysplitting (SPLIT_TT_HOR). In vertical ternary splitting (SPLIT_TT_VER),the current CU is split in the vertical direction at a ratio of 1:2:1.As shown in FIG. 5 , by vertical ternary splitting, two CUs having thesame height as the current CU and having a width which is 1/4 of thewidth of the current CU and a CU having the same height as the currentCU and having a width which is half the width of the current CU may begenerated. In horizontal ternary splitting (SPLIT_TT_HOR), the currentCU is split in the horizontal direction at a ratio of 1:2:1. As shown inFIG. 5 , by horizontal ternary splitting, two CUs having a height whichis 1/4 of the height of the current CU and having the same width as thecurrent CU and a CU having a height which is half the height of thecurrent CU and having the same width as the current CU may be generated.

FIG. 6 is a view showing a signaling mechanism of block splittinginformation in a quadtree with nested multi-type tree structureaccording to the present disclosure.

Here, the CTU is treated as the root node of the quadtree, and ispartitioned for the first time into a quadtree structure. Information(e.g., qt_split_flag) specifying whether quadtree splitting is performedon the current CU (CTU or node (QT_node) of the quadtree) is signaled.For example, when qt_split_flag has a first value (e.g., “1”), thecurrent CU may be quadtree-partitioned. In addition, when qt_split_flaghas a second value (e.g., “0”), the current CU is notquadtree-partitioned, but becomes the leaf node (QT_leaf_node) of thequadtree. Each quadtree leaf node may then be further partitioned intomultitype tree structures. That is, the leaf node of the quadtree maybecome the node (MTT_node) of the multi-type tree. In the multitype treestructure, a first flag (e.g., Mtt_split_cu_flag) is signaled to specifywhether the current node is additionally partitioned. If thecorresponding node is additionally partitioned (e.g., if the first flagis 1), a second flag (e.g., Mtt_split_cu_vertical_flag) may be signaledto specify the splitting direction. For example, the splitting directionmay be a vertical direction if the second flag is 1 and may be ahorizontal direction if the second flag is 0. Then, a third flag (e.g.,Mtt_split_cu_binary_flag) may be signaled to specify whether the splittype is a binary split type or a ternary split type. For example, thesplit type may be a binary split type when the third flag is 1 and maybe a ternary split type when the third flag is 0. The node of themulti-type tree acquired by binary splitting or ternary splitting may befurther partitioned into multi-type tree structures. However, the nodeof the multi-type tree may not be partitioned into quadtree structures.If the first flag is 0, the corresponding node of the multi-type tree isno longer split but becomes the leaf node (MTT_leaf_node) of themulti-type tree. The CU corresponding to the leaf node of the multi-typetree may be used as the above-described final coding unit.

Based on the mtt_split_cu_vertical_flag and themtt_split_cu_binary_flag, a multi-type tree splitting mode(MttSplitMode) of a CU may be derived as shown in Table 1 below. In thefollowing description, the multi-type tree splitting mode may bereferred to as a multi-tree splitting type or splitting type.

TABLE 1 MttSplitMode mtt_split_cu_vertical_flag mtt_split_cu_binary_flagSPLIT_TT_HOR 0 0 SPLIT_BT_HOR 0 1 SPLIT_TT_VER 1 0 SPLIT_BT_VER 1 1

FIG. 7 is a view showing an example in which a CTU is partitioned intomultiple CUs by applying a multi-type tree after applying a quadtree. InFIG. 7 , bold block edges 710 represent quadtree partitioning and theremaining edges 720 represent multitype tree partitioning. The CU maycorrespond to a coding block (CB). In an embodiment, the CU may includea coding block of luma samples and two coding blocks of chroma samplescorresponding to the luma samples. A chroma component (sample) CB or TBsize may be derived based on a luma component (sample) CB or TB sizeaccording to the component ratio according to the color format (chromaformat, e.g., 4:4:4, 4:2:2, 4:2:0 or the like) of the picture/image. Incase of 4:4:4 color format, the chroma component CB/TB size may be setequal to be luma component CB/TB size. In case of 4:2:2 color format,the width of the chroma component CB/TB may be set to half the width ofthe luma component CB/TB and the height of the chroma component CB/TBmay be set to the height of the luma component CB/TB. In case of 4:2:0color format, the width of the chroma component CB/TB may be set to halfthe width of the luma component CB/TB and the height of the chromacomponent CB/TB may be set to half the height of the luma componentCB/TB.

In an embodiment, when the size of the CTU is 128 based on the lumasample unit, the size of the CU may have a size from 128×128 to 4×4which is the same size as the CTU. In one embodiment, in case of 4:2:0color format (or chroma format), a chroma CB size may have a size from64×64 to 2×2.

Meanwhile, in an embodiment, the CU size and the TU size may be thesame. Alternatively, there may be a plurality of TUs in a CU region. TheTU size generally represents a luma component (sample) transform block(TB) size.

The TU size may be derived based a largest allowable TB size maxTbSizewhich is a predetermined value. For example, when the CU size is greaterthan maxTb Size, a plurality of TUs (TBs) having maxTbSize may bederived from the CU and transform/inverse transform may be performed inunits of TU (TB). For example, the largest allowable luma TB size may be64×64 and the largest allowable chroma TB size may be 32×32. If thewidth or height of the CB partitioned according to the tree structure islarger than the largest transform width or height, the CB may beautomatically (or implicitly) partitioned until the TB size limit in thehorizontal and vertical directions is satisfied.

In addition, for example, when intra prediction is applied, an intraprediction mode/type may be derived in units of CU (or CB) and aneighboring reference sample derivation and prediction sample generationprocedure may be performed in units of TU (or TB). In this case, theremay be one or a plurality of TUs (or TBs) in one CU (or CB) region and,in this case, the plurality of TUs or (TBs) may share the same intraprediction mode/type.

Meanwhile, for a quadtree coding tree scheme with nested multitype tree,the following parameters may be signaled as SPS syntax elements from theencoding apparatus to the decoding apparatus. For example, at least oneof a CTU size which is a parameter representing the root node size of aquadtree, MinQTSize which is a parameter representing the minimumallowed quadtree leaf node size, MaxBtSize which is a parameterrepresenting the maximum allowed binary tree root node size, MaxTtSizewhich is a parameter representing the maximum allowed ternary tree rootnode size, MaxMttDepth which is a parameter representing the maximumallowed hierarchy depth of multi-type tree splitting from a quadtreeleaf node, MinBtSize which is a parameter representing the minimumallowed binary tree leaf node size, or MinTtSize which is a parameterrepresenting the minimum allowed ternary tree leaf node size issignaled.

As an embodiment of using 4:2:0 chroma format, the CTU size may be setto 128×128 luma blocks and two 64×64 chroma blocks corresponding to theluma blocks. In this case, MinOTSize may be set to 16×16, MaxBtSize maybe set to 128×128, MaxTtSzie may be set to 64×64, MinBtSize andMinTtSize may be set to 4×4, and MaxMttDepth may be set to 4. Quadtreepartitioning may be applied to the CTU to generate quadtree leaf nodes.The quadtree leaf node may be called a leaf QT node. Quadtree leaf nodesmay have a size from a 16×16 size (e.g., the MinOTSize) to a 128×128size (e.g., the CTU size). If the leaf QT node is 128×128, it may not beadditionally partitioned into a binary tree/ternary tree. This isbecause, in this case, even if partitioned, it exceeds MaxBtsize andMaxTtszie (e.g., 64×64). In other cases, leaf QT nodes may be furtherpartitioned into a multitype tree. Therefore, the leaf QT node is theroot node for the multitype tree, and the leaf QT node may have amultitype tree depth (mttDepth) 0 value. If the multitype tree depthreaches MaxMttdepth (e.g., 4), further partitioning may not beconsidered further. If the width of the multitype tree node is equal toMinBtSize and less than or equal to 2×MinTtSize, then no furtherhorizontal partitioning may be considered. If the height of themultitype tree node is equal to MinBtSize and less than or equal to2×MinTtSize, no further vertical partitioning may be considered. Whenpartitioning is not considered, the encoding apparatus may skipsignaling of partitioning information. In this case, the decodingapparatus may derive partitioning information with a predeterminedvalue.

Meanwhile, one CTU may include a coding block of luma samples(hereinafter referred to as a “luma block”) and two coding blocks ofchroma samples corresponding thereto (hereinafter referred to as “chromablocks”). The above-described coding tree scheme may be equally orseparately applied to the luma block and chroma block of the current CU.Specifically, the luma and chroma blocks in one CTU may be partitionedinto the same block tree structure and, in this case, the tree structureis represented as SINGLE_TREE. Alternatively, the luma and chroma blocksin one CTU may be partitioned into separate block tree structures, and,in this case, the tree structure may be represented as DUAL_TREE. Thatis, when the CTU is partitioned into dual trees, the block treestructure for the luma block and the block tree structure for the chromablock may be separately present. In this case, the block tree structurefor the luma block may be called DUAL_TREE_LUMA, and the block treestructure for the chroma component may be called DUAL_TREE_CHROMA. For Pand B slice/tile groups, luma and chroma blocks in one CTU may belimited to have the same coding tree structure. However, for Islice/tile groups, luma and chroma blocks may have a separate block treestructure from each other. If the separate block tree structure isapplied, the luma CTB may be partitioned into CUs based on a particularcoding tree structure, and the chroma CTB may be partitioned into chromaCUs based on another coding tree structure. That is, this means that aCU in an I slice/tile group, to which the separate block tree structureis applied, may include a coding block of luma components or codingblocks of two chroma components and a CU of a P or B slice/tile groupmay include blocks of three color components (a luma component and twochroma components).

Although a quadtree coding tree structure with a nested multitype treehas been described, a structure in which a CU is partitioned is notlimited thereto. For example, the BT structure and the TT structure maybe interpreted as a concept included in a multiple partitioning tree(MPT) structure, and the CU may be interpreted as being partitionedthrough the QT structure and the MPT structure. In an example where theCU is partitioned through a QT structure and an MPT structure, a syntaxelement (e.g., MPT_split_type) including information on how many blocksthe leaf node of the QT structure is partitioned into and a syntaxelement (ex. MPT_split_mode) including information on which of verticaland horizontal directions the leaf node of the QT structure ispartitioned into may be signaled to determine a partitioning structure.

In another example, the CU may be partitioned in a different way thanthe QT structure, BT structure or TT structure. That is, unlike that theCU of the lower depth is partitioned into 1/4 of the CU of the higherdepth according to the QT structure, the CU of the lower depth ispartitioned into 1/2 of the CU of the higher depth according to the BTstructure, or the CU of the lower depth is partitioned into 1/4 or 1/2of the CU of the higher depth according to the TT structure, the CU ofthe lower depth may be partitioned into 1/5, 1/3, 3/8, 3/5, 2/3, or 5/8of the CU of the higher depth in some cases, and the method ofpartitioning the CU is not limited thereto.

The quadtree coding block structure with the multi-type tree may providea very flexible block partitioning structure. Because of the partitiontypes supported in a multi-type tree, different partition patterns maypotentially result in the same coding block structure in some cases. Inthe encoding apparatus and the decoding apparatus, by limiting theoccurrence of such redundant partition patterns, a data amount ofpartitioning information may be reduced.

Quantization/Dequantization

As described above, the quantizer of the encoding apparatus may derivequantized transform coefficients by applying quantization to transformcoefficients, and the dequantizer of the encoding apparatus or thedequantizer of the decoding apparatus ma derive transform coefficientsby applying dequantization to the quantized transform coefficients.

In encoding and decoding of moving image/still image, a quantizationrate may be changed and a compression rate may be adjusted using thechanged quantization rate. From an implementation point of view, inconsideration of complexity, a quantization parameter (QP) may be usedinstead of directly using the quantization rate. For example, aquantization parameter having an integer value of 0 to 63 may be usedand each quantization parameter value may correspond to an actualquantization rate. In addition, a quantization parameter QP_(Y) for aluma component (luma sample) and a quantization parameter Q_(C) for achroma component (chroma sample) may be differently set.

In a quantization process, a transform coefficient C may be received asinput and divided by quantization rate Qstep, and a quantized transformcoefficient C′ may be obtained based on this. In this case, inconsideration of computational complexity, the quantization rate ismultiplied by a scale to form an integer and shift operation may beperformed by a value corresponding to the scale value. Based on theproduct of the quantization rate and the scale value, a quantizationscale may be derived. That is, the quantization scale may be derivedaccording to QP. By applying the quantization scale to the transformcoefficient C, the quantized transform coefficient C′ may be derivedbased on this.

A dequantization process is an inverse process of the quantizationprocess, and the quantized transform coefficient C′ may be multiplied bythe quantization rate Qstep and a reconstructed transform coefficient C″may be obtained based on this. In this case, a level scale may bederived according to the quantization parameter, the level scale may beapplied to the quantization transform coefficient C′, and thereconstructed transform coefficient C″ may be derived based on this. Thereconstructed transform coefficient C″ may be slightly different fromthe original transform coefficient C due to loss in the transform and/orquantization process. Accordingly, even the encoding apparatus mayperform dequantization in the same manner as the decoding apparatus.

Meanwhile, adaptive frequency weighting quantization technology ofadjusting a quantization strength according to frequency may apply. Theadaptive frequency weighting quantization technology is a method ofdifferently applying a quantization strength according to the frequency.In adaptive frequency weighting quantization, the quantization strengthmay differently apply according to the frequency using a predefinedquantization scaling matrix. That is, the above-describedquantization/dequantization process may be performed further based onthe quantization scaling matrix. For example, a different quantizationscaling matrix may be used according to a size of a current block and/orwhether a prediction mode applying to the current block in order togenerate a residual signal of the current block is inter prediction orintra prediction. The quantization scaling matrix may also be referredto as a quantization matrix or a scaling matrix. The quantizationscaling matrix may be predefined. In addition, frequency quantizationscale information for the quantization scaling matrix for frequencyadaptive scaling may be constructed/encoded by the encoding apparatusand signaled to the decoding apparatus. The frequency quantization scaleinformation may be referred to as quantization scaling information. Thefrequency quantization scale information may include scaling list datascaling_list_data. Based on the scaling list data, the (modified)quantization scaling matrix may be derived. In addition, the frequencyquantization scale information may include present flag informationspecifying whether the scaling list data is present. Alternatively, whenthe scaling list data is signaled at a higher level (e.g., SPS),information specifying whether the scaling list data is modified at alower level (e.g., PPS or tile group header, etc.) may be furtherincluded.

Entropy Coding

Some or all of video/image information may be entropy-encoded by theentropy encoder 190 as described above with reference to FIG. 2 , andsome or all of video/image information described with reference to FIG.3 may be entropy-decoded by the entropy decoder 310. In this case, thevideo/image information may be encoded/decoded in units of syntaxelements. In the present disclosure, encoding/decoding information mayinclude encoding/decoding by the method described in this section.

FIG. 8 is a block diagram of CABAC according to an embodiment forencoding one syntax element. In an encoding process of CABAC, first,when an input signal is a syntax element having a non-binary value, theinput signal may be converted into a binary value through binarization.When the input signal already has a binary value, binarization may bebypassed without being performed. Here, a binary number 0 or 1constructing a binary value may be referred to as a bin. For example,when a binary string (bin string) after binarization is 110, each of 1,1 and 0 may be referred to as one bin. The bin(s) for one syntax elementmay specify the value of the corresponding syntax element.

The binarized bins may be input to a regular coding engine or a bypasscoding engine. The regular coding engine may allocate a context modelreflecting a probability value to the corresponding bin and encode thecorresponding bin based on the allocated context model. In the regularcoding engine, after performing coding on each bin, a probabilisticmodel for the corresponding bin may be updated. The bins coded in thisway may be referred to as context-coded bins. In the bypass codingengine, a procedure for estimating a probability for the input bin and aprocedure for updating a probabilistic model applying to thecorresponding bin after coding may be omitted. In the case of the bypasscoding engine, instead of allocating context, a coding rate may beimproved by coding a bin input by applying a uniform probabilitydistribution (e.g., 50:50). The bins coded in this way may be referredto as bypass bins. The context model may be allocated and updated foreach context-coded (regularly coded) bin, and the context model may bespecified based on ctxidx or ctxInc. ctxidx may be derived based onctxInc. Specifically, for example, a context index ctxidx specifying acontext model for each of the regularly coded bins may be derived as asum of a context index increment ctxInc and a context index offsetctxIdxOffset. Here, ctxInc may be derived differently for each bin.ctxIdxOffset may be represented by the lowest value of ctxIdx. Thelowest value of ctxIdx may be referred to as an initial value initValueof ctxIdx. ctxIdxOffset is a value used for distinguishment with contextmodels for other syntax elements, and a context model for one syntaxelement may be distinguished/derived based on ctxinc.

In the entropy encoding procedure, whether encoding is performed throughthe regular coding engine or the bypass coding engine may be determinedand a coding path may be switched. In entropy decoding, the same processas entropy encoding may be performed in reverse order.

The above-described coding may be performed, for example, as shown inFIGS. 9 and 10 . Referring to FIGS. 9 and 10 , the encoding apparatus(entropy encoder) may perform an entropy coding procedure of image/videoinformation. The image/video information may include partitioningrelated information, prediction related information (e.g., inter/intraprediction classification information, intra prediction modeinformation, inter prediction mode information, etc.), residualinformation, in-loop filtering related information, etc., or varioussyntax elements related thereto. The entropy coding may be performed inunits of syntax elements. Steps S910 to S920 of FIG. 9 may be performedby the entropy encoder 190 of the encoding apparatus of FIG. 2 .

The encoding apparatus may perform binarization on a target syntaxelement (S910). Here, binarization may be based on various binarizationmethods such as a Truncated Rice binarization process, a Fixed-lengthbinarization process, etc., and the binarization method for the targetsyntax element may be predefined. The binarization procedure may beperformed by a binarization unit 191 in the entropy encoder 190.

The encoding apparatus may perform entropy encoding on the target syntaxelement (S920). The encoding apparatus may regular-coding-based(context-based) or bypass-coding-based encode a bin string of the targetsyntax element based on an entropy coding technique such ascontext-adaptive arithmetic coding (CABAC) or context-adaptive variablelength coding (CAVLC), and the output thereof may be included in abitstream. The entropy encoding procedure may be performed by an entropyencoding processor 192 in the entropy encoder 190. The bitstream may betransmitted to the decoding apparatus through a (digital) storage mediumor a network as described above.

Referring to FIGS. 11 and 12 , the decoding apparatus (entropy decoder)may decode encoded image/video information. The image/video informationmay include partitioning related information, prediction relatedinformation (e.g., inter/intra prediction classification information,intra prediction mode information, inter prediction mode information,etc.), residual information, in-loop filtering related information,etc., or various syntax elements related thereto. The entropy coding maybe performed in units of syntax elements. Steps S1110 to S1120 may beperformed by the entropy decoder 210 of the decoding apparatus of FIG. 3.

The decoding apparatus may perform binarization on a target syntaxelement (S1110). Here, binarization may be based on various binarizationmethods such as Truncated Rice binarization process, Fixed-lengthbinarization process, etc., and the binarization method for the targetsyntax element may be predefined. The decoding apparatus may deriveavailable bin strings (bin string candidates) for available values ofthe target syntax element through the binarization procedure. Thebinarization procedure may be performed by a binarization unit 211 inthe entropy decoder 210.

The decoding apparatus may perform entropy decoding on the target syntaxelement (S1120). The decoding apparatus may compare the derived binstring with available bin strings for the corresponding syntax element,while sequentially decoding and parsing bins for the target syntaxelement from input bit(s) in the bitstream. If the derived bin string isequal to one of the available bin strings, a value corresponding to thecorresponding bin string may be derived as a value of the correspondingsyntax element. If not, a next bit in the bitstream may be furtherparsed and then the above-described procedure may be performed again.Through this process, the corresponding information may be signaledusing a variable length bit without using a start bit or an end bit forspecific information (specific syntax element) in the bitstream. Throughthis, relatively fewer bits may be allocated to a low value and overallcoding efficiency may be increased.

The decoding apparatus may context-based or bypass-coding-based decodeeach bin in the bin string from the bitstream based on an entropy codingtechnique such as CABAC or CAVLC. The entropy decoding procedure may beperformed by an entropy decoding processor 212 in the entropy decoder210. The bitstream may include a variety of information for image/videodecoding as described above. The bitstream be transmitted to thedecoding apparatus through a (digital) storage medium or a network asdescribed above.

In this disclosure, a table (syntax table) including syntax elements maybe used to specify signaling of information from the encoding apparatusto the decoding apparatus. The order of the syntax elements of the tableincluding the syntax elements used in this disclosure may specify aparsing order of the syntax elements from the bitstream. The encodingapparatus may construct and encode the syntax table such that the syntaxelements are parsed by the decoding apparatus in parsing order, and thedecoding apparatus may obtain values of the syntax elements by parsingand decoding the syntax elements of the syntax table from the bitstreamin parsing order.

General Image/Video Coding Procedure

In image/video coding, a picture configuring an image/video may beencoded/decoded according to a decoding order. A picture ordercorresponding to an output order of the decoded picture may be setdifferently from the decoding order, and, based on this, not onlyforward prediction but also backward prediction may be performed duringinter prediction.

FIG. 13 shows an example of a schematic picture decoding procedure, towhich embodiment(s) of the present disclosure is applicable. In FIG. 13, S1310 may be performed in the entropy decoder 210 of the decodingapparatus described above with reference to FIG. 3 , S1320 may beperformed in a prediction unit including the intra prediction unit 265and the inter prediction unit 260, S1330 may be performed in a residualprocessor including the dequantizer 220 and the inverse transformer 230,S1340 may be performed in the adder 235, and S1350 may be performed inthe filter 240. S1310 may include the information decoding proceduredescribed in the present disclosure, S1320 may include the inter/intraprediction procedure described in the present disclosure, S1330 mayinclude a residual processing procedure described in the presentdisclosure, S1340 may include the block/picture reconstruction proceduredescribed in the present disclosure, and S1350 may include the in-loopfiltering procedure described in the present disclosure.

Referring to FIG. 13 , the picture decoding procedure may schematicallyinclude a procedure for obtaining image/video information (throughdecoding) from a bitstream (S1310), a picture reconstruction procedure(S1320 to S1340) and an in-loop filtering procedure for a reconstructedpicture (S1350), as described above with reference to FIG. 3 . Thepicture reconstruction procedure may be performed based on predictionsamples and residual samples obtained through inter/intra prediction(S1320) and residual processing (S1330) (dequantization and inversetransform of the quantized transform coefficient) described in thepresent disclosure. A modified reconstructed picture may be generatedthrough the in-loop filtering procedure for the reconstructed picturegenerated through the picture reconstruction procedure, the modifiedreconstructed picture may be output as a decoded picture, stored in adecoded picture buffer or memory 250 of the decoding apparatus and usedas a reference picture in the inter prediction procedure when decodingthe picture later. In some cases, the in-loop filtering procedure may beomitted. In this case, the reconstructed picture may be output as adecoded picture, stored in a decoded picture buffer or memory 250 of thedecoding apparatus, and used as a reference picture in the interprediction procedure when decoding the picture later. The in-loopfiltering procedure (S1350) may include a deblocking filteringprocedure, a sample adaptive offset (SAO) procedure, an adaptive loopfilter (ALF) procedure and/or a bi-lateral filter procedure, asdescribed above, some or all of which may be omitted. In addition, oneor some of the deblocking filtering procedure, the sample adaptiveoffset (SAO) procedure, the adaptive loop filter (ALF) procedure and/orthe bi-lateral filter procedure may be sequentially applied or all ofthem may be sequentially applied. For example, after the deblockingfiltering procedure is applied to the reconstructed picture, the SAOprocedure may be performed. Alternatively, for example, after thedeblocking filtering procedure is applied to the reconstructed picture,the ALF procedure may be performed. This may be similarly performed evenin the encoding apparatus.

FIG. 14 shows an example of a schematic picture encoding procedure, towhich embodiment(s) of the present disclosure is applicable. In FIG. 14, S1410 may be performed in the prediction unit including the intraprediction unit 185 or inter prediction unit 180 of the encodingapparatus described above with reference to FIG. 2 , S1420 may beperformed in a residual processor including the transformer 120 and/orthe quantizer 130, and S1430 may be performed in the entropy encoder190. S1410 may include the inter/intra prediction procedure described inthe present disclosure, S1420 may include the residual processingprocedure described in the present disclosure, and S1430 may include theinformation encoding procedure described in the present disclosure.

Referring to FIG. 14 , the picture encoding procedure may schematicallyinclude not only a procedure for encoding and outputting information forpicture reconstruction (e.g., prediction information, residualinformation, partitioning information, etc.) in the form of a bitstreambut also a procedure for generating a reconstructed picture for acurrent picture and a procedure (optional) for applying in-loopfiltering to a reconstructed picture, as described with respect to FIG.2 . The encoding apparatus may derive (modified) residual samples from aquantized transform coefficient through the dequantizer 140 and theinverse transformer 150, and generate the reconstructed picture based onthe prediction samples, which are output of S1410, and the (modified)residual samples. The reconstructed picture generated in this way may beequal to the reconstructed picture generated in the decoding apparatus.The modified reconstructed picture may be generated through the in-loopfiltering procedure for the reconstructed picture, may be stored in thedecoded picture buffer or memory 170, and may be used as a referencepicture in the inter prediction procedure when encoding the picturelater, similarly to the decoding apparatus. As described above, in somecases, some or all of the in-loop filtering procedure may be omitted.When the in-loop filtering procedure is performed, (in-loop) filteringrelated information (parameter) may be encoded in the entropy encoder190 and output in the form of a bitstream, and the decoding apparatusmay perform the in-loop filtering procedure using the same method as theencoding apparatus based on the filtering related information.

Through such an in-loop filtering procedure, noise occurring duringimage/video coding, such as blocking artifact and ringing artifact, maybe reduced and subjective/objective visual quality may be improved. Inaddition, by performing the in-loop filtering procedure in both theencoding apparatus and the decoding apparatus, the encoding apparatusand the decoding apparatus may derive the same prediction result,picture coding reliability may be increased and the amount of data to betransmitted for picture coding may be reduced.

As described above, the picture reconstruction procedure may beperformed not only in the decoding apparatus but also in the encodingapparatus. A reconstructed block may be generated based on intraprediction/inter prediction in units of blocks, and a reconstructedpicture including reconstructed blocks may be generated. When a currentpicture/slice/tile group is an I picture/slice/tile group, blocksincluded in the current picture/slice/tile group may be reconstructedbased on only intra prediction. Meanwhile, when the currentpicture/slice/tile group is a P or B picture/slice/tile group, blocksincluded in the current picture/slice/tile group may be reconstructedbased on intra prediction or inter prediction. In this case, interprediction may be applied to some blocks in the currentpicture/slice/tile group and intra prediction may be applied to theremaining blocks. The color component of the picture may include a lumacomponent and a chroma component and the methods and embodiments of thepresent disclosure are applicable to the luma component and the chromacomponent unless explicitly limited in the present disclosure.

Example of Coding Layer and Structure

A coded video/image according to the present disclosure may beprocessed, for example, according to a coding layer and structure whichwill be described below.

FIG. 15 is a view showing a layer structure for a coded image. The codedimage may be classified into a video coding layer (VCL) for an imagedecoding process and handling itself, a low-level system fortransmitting and storing encoded information, and a network abstractionlayer (NAL) present between the VCL and the low-level system andresponsible for a network adaptation function.

In the VCL, VCL data including compressed image data (slice data) may begenerated or a supplemental enhancement information (SEI) messageadditionally required for a decoding process of an image or a parameterset including information such as a picture parameter set (PPS), asequence parameter set (SPS) or a video parameter set (VPS) may begenerated.

In the NAL, header information (NAL unit header) may be added to a rawbyte sequence payload (RB SP) generated in the VCL to generate an NALunit. In this case, the RB SP refers to slice data, a parameter set, anSEI message generated in the VCL. The NAL unit header may include NALunit type information specified according to RBSP data included in acorresponding NAL unit.

As shown in the figure, the NAL unit may be classified into a VCL NALunit and a non-VCL NAL unit according to the RBSP generated in the VCL.The VCL NAL unit may mean a NAL unit including information on an image(slice data), and the Non-VCL NAL unit may mean a NAL unit includinginformation (parameter set or SEI message) required to decode an image.

The VCL NAL unit and the Non-VCL NAL unit may be attached with headerinformation and transmitted through a network according to the datastandard of the low-level system. For example, the NAL unit may bemodified into a data format of a predetermined standard, such asH.266/VVC file format, RTP (Real-time Transport Protocol) or TS(Transport Stream), and transmitted through various networks.

As described above, in the NAL unit, a NAL unit type may be specifiedaccording to the RBSP data structure included in the corresponding NALunit, and information on the NAL unit type may be stored in a NAL unitheader and signalled.

For example, this may be largely classified into a VCL NAL unit type anda non-VCL NAL unit type depending on whether the NAL unit includesinformation on an image (slice data). The VCL NAL unit type may beclassified according to the property and type of the picture included inthe VCL NAL unit, and the Non-VCL NAL unit type may be classifiedaccording to the type of a parameter set.

An example of the NAL unit type specified according to the type of theparameter set included in the Non-VCL NAL unit type will be listedbelow.

-   -   APS (Adaptation Parameter Set) NAL unit: Type for NAL unit        including APS    -   DPS (Decoding Parameter Set) NAL unit: Type for NAL unit        including DPS    -   VPS (Video Parameter Set) NAL unit: Type for NAL unit including        VPS    -   SPS (Sequence Parameter Set) NAL unit: Type for NAL unit        including SPS    -   PPS (Picture Parameter Set) NAL unit: Type for NAL unit        including PPS

The above-described NAL unit types may have syntax information for a NALunit type, and the syntax information may be stored in a NAL unit headerand signalled. For example, the syntax information may be nal_unit_type,and the NAL unit types may be specified as nal_unit_type values.

The slice header (slice header syntax) may includeinformation/parameters commonly applicable to the slice. The APS (APSsyntax) or PPS (PPS syntax) may include information/parameters commonlyapplicable to one or more slices or pictures. The SPS (SPS syntax) mayinclude information/parameters commonly applicable to one or moresequences. The VPS (VPS syntax) may include information/parameterscommonly applicable to multiple layers. The DPS (DPS syntax) may includeinformation/parameters commonly applicable to overall video. The DPS mayinclude information/parameters related to concatenation of a coded videosequence (CVS). In the present disclosure, a high level syntax (HLS) mayinclude at least one of the APS syntax, the PPS syntax, the SPS syntax,the VPS syntax, the DPD syntax or the slice header syntax.

In the present disclosure, image/video information encoded in theencoding apparatus and signalled to the decoding apparatus in the formof a bitstream may include not only in-picture partitioning relatedinformation, intra/inter prediction information, residual information,in-loop filtering information but also information on the slice header,information on the APS, information on the PPS, information on the SPS,and/or information on the VPS.

Overview of Inter Prediction

Hereinafter, detailed technology of an inter prediction method in thedescription of encoding and decoding with reference to FIGS. 2 and 3will be described. In the case of the decoding apparatus, the interprediction based video/image decoding method and the inter predictionunit in the decoding apparatus may operate according to the followingdescription. In addition, data encoded by the following description maybe stored in the form of a bitstream.

The prediction unit of an encoding/decoding apparatus may perform interprediction in units of blocks to derive a prediction sample. Interprediction may represent prediction derived in a manner that isdependent on data elements (e.g., sample values, motion information,etc.) of picture(s) other than a current picture. When inter predictionapplies to the current block, a predicted block (prediction samplearray) for the current block may be derived based on a reference block(reference sample array) specified by a motion vector on a referencepicture indicated by a reference picture index. In this case, in orderto reduce the amount of motion information transmitted in an interprediction mode, motion information of the current block may bepredicted in units of blocks, subblocks or samples, based on correlationof motion information between a neighboring block and the current block.The motion information may include a motion vector and a referencepicture index. The motion information may further include interprediction type (L0 prediction, L1 prediction, Bi prediction, etc.)information. When applying inter prediction, the neighboring block mayinclude a spatial neighboring block present in the current picture and atemporal neighboring block present in the reference picture. A referencepicture including the reference block and a reference picture includingthe temporal neighboring block may be the same or different. Thetemporal neighboring block may be referred to as a collocated referenceblock, collocated CU (ColCU), and the reference picture including thetemporal neighboring block may be referred to as a collocated picture(colPic). For example, a motion information candidate list may beconstructed based on the neighboring blocks of the current block, andflag or index information indicating which candidate is selected (used)may be signaled in order to derive the motion vector of the currentblock and/or the reference picture index. Inter prediction may beperformed based on various prediction modes. For example, in the case ofa skip mode and a merge mode, the motion information of the currentblock may be equal to the motion information of the selected neighboringblock. In the case of the skip mode, a residual signal may not betransmitted unlike the merge mode. In the case of a motion informationprediction (MVP) mode, the motion vector of the selected neighboringblock may be used as a motion vector predictor and a motion vectordifference may be signaled. In this case, the motion vector of thecurrent block may be derived using a sum of the motion vector predictorand the motion vector difference.

The motion information may include L0 motion information and/or L1motion information according to the inter prediction type (L0prediction, L1 prediction, Bi prediction, etc.). The motion vector in anL0 direction may be referred to as an L0 motion vector or MVL0, and themotion vector in an L1 direction may be referred to as an L1 motionvector or MVL1. Prediction based on the L0 motion vector may be referredto as L0 prediction, prediction based on the L1 motion vector may bereferred to as L1 prediction, and prediction based both the L0 motionvector and the L1 motion vector may be referred to as Bi prediction.Here, the L0 motion vector may indicate a motion vector associated witha reference picture list L0 (L0) and the L1 motion vector may indicate amotion vector associated with a reference picture list L1 (L1). Thereference picture list L0 may include pictures before the currentpicture in output order as reference pictures, and the reference picturelist L1 may include pictures after the current picture in output order.The previous pictures may be referred to as forward (reference) picturesand the subsequent pictures may be referred to as reverse (reference)pictures. The reference picture list L0 may further include picturesafter the current picture in output order as reference pictures. In thiscase, within the reference picture list L0, the previous pictures may befirst indexed and the subsequent pictures may then be indexed. Thereference picture list L1 may further include pictures before thecurrent picture in output order as reference pictures. In this case,within the reference picture list L1, the subsequent pictures may befirst indexed and the previous pictures may then be indexed. Here, theoutput order may correspond to picture order count (POC) order.

The video/image encoding procedure based on inter prediction and theinter prediction unit in the encoding apparatus may schematicallyinclude, for example, the following, which will be described withreference to FIG. 16 . The encoding apparatus performs inter predictionwith respect to a current block (S1610). The image encoding apparatusmay derive an inter prediction mode and motion information of thecurrent block and generate prediction samples of the current block.Here, inter prediction mode determination, motion information derivationand prediction samples generation procedures may be simultaneouslyperformed or any one thereof may be performed before the otherprocedures. For example, the inter prediction unit of the encodingapparatus may include a prediction mode determination unit, a motioninformation derivation unit and a prediction sample derivation unit, andthe prediction mode determination unit may determine the prediction modeof the current block, the motion information derivation unit may derivethe motion information of the current block, and the prediction samplederivation unit may derive the prediction samples of the current block.For example, the inter prediction unit of the encoding apparatus maysearch for a block similar to the current block within a predeterminedarea (search area) of reference pictures through motion estimation, andderive a reference block whose difference from the current block isequal to or less than a predetermined criterion or a minimum. Based onthis, a reference picture index indicating a reference picture in whichthe reference block is located may be derived, and a motion vector maybe derived based on a position difference between the reference blockand the current block. The encoding apparatus may determine a modeapplying to the current block among various prediction modes. Theencoding apparatus may compare RD costs for the various prediction modesand determine an optimal prediction mode of the current block.

For example, when a skip mode or a merge mode applies to the currentblock, the encoding apparatus may construct a merge candidate listdescribed below and derive a reference block whose difference from thecurrent block is equal to or less than a predetermined criterion or aminimum, among reference blocks indicated by merge candidates includedin the merge candidate list. In this case, a merge candidate associatedwith the derived reference block may be selected, and merge indexinformation indicating the selected merge candidate may be generated andsignaled to the decoding apparatus. The motion information of thecurrent block may be derived using the motion information of theselected merge candidate.

As another example, when an (A)MVP mode applies to the current block,the encoding apparatus may construct an (A)mvp candidate list describedbelow and derive a motion vector of an mvp candidate selected from amongmvp candidates included in the (a)MVP candidate list. In this case, forexample, the motion vector indicating the reference block derived by theabove-described motion estimation may be used as the motion vector ofthe current block, an mvp candidate with a motion vector having asmallest difference from the motion vector of the current block amongthe mvp candidates may be the selected mvp candidate. A motion vectordifference (MVD) which is a difference obtained by subtracting the mvpfrom the motion vector of the current block may be derived. In thiscase, information on the MVD may be signaled to the decoding apparatus.In addition, when applying the (A)MVP mode, the value of the referencepicture index may be constructed as reference picture index informationand separately signaled to the decoding apparatus.

The encoding apparatus may derive residual samples based on theprediction samples (S1620). The encoding apparatus may derive theresidual samples through comparison between original samples of thecurrent block and the prediction samples.

The encoding apparatus encodes image information including predictioninformation and residual information (S1630). The encoding apparatus mayoutput the encoded image information in the form of a bitstream. Theprediction information may include prediction mode information (e.g.,skip flag, merge flag or mode index, etc.) and information on motioninformation as information related to the prediction procedure. Theinformation on the motion information may include candidate selectioninformation (e.g., merge index, mvp flag or mvp index) which isinformation for deriving a motion vector. In addition, the informationon the motion information may include information on the above-describedMVD and/or reference picture index information. In addition, theinformation on the motion information may include information indicatingwhether to apply L0 prediction, L1 prediction or bi prediction. Theresidual information is information on the residual samples. Theresidual information may include information on quantized transformcoefficients for the residual samples.

The output bitstream may be stored in a (digital) storage medium andtransmitted to the decoding apparatus or may be transmitted to thedecoding apparatus via a network.

As described above, the encoding apparatus may generate a reconstructedpicture (including reconstructed samples and a reconstructed block)based on the reference samples and the residual samples. This is for theencoding apparatus to derive the same prediction result as thatperformed by the decoding apparatus, thereby increasing codingefficiency. Accordingly, the encoding apparatus may store thereconstructed picture (or the reconstructed samples and thereconstructed block) in a memory and use the same as a reference picturefor inter prediction. As described above, an in-loop filtering procedureis further applicable to the reconstructed picture.

The inter prediction based video/image decoding procedure and the interprediction unit in the decoding apparatus may schematically include, forexample, the following.

The decoding apparatus may perform operation corresponding to operationperformed by the encoding apparatus. The decoding apparatus may performprediction with respect to a current block based on received predictioninformation and derive prediction samples.

Specifically, the decoding apparatus may determine the prediction modeof the current block based on the received prediction information(S1710). The image decoding apparatus may determine which interprediction mode applies to the current block based on the predictionmode information in the prediction information.

For example, it may be determined whether the merge mode or the (A)MVPmode applies to the current block based on the merge flag.Alternatively, one of various inter prediction mode candidates may beselected based on the mode index. The inter prediction mode candidatesmay include a skip mode, a merge mode and/or an (A)MVP mode or mayinclude various inter prediction modes which will be described below.

The decoding apparatus may derive the motion information of the currentblock based on the determined inter prediction mode (S1720). Forexample, when the skip mode or the merge mode applies to the currentblock, the decoding apparatus may construct a merge candidate list,which will be described below, and select one of merge candidatesincluded in the merge candidate list. The selection may be performedbased on the above-described candidate selection information (mergeindex). The motion information of the current block may be derived usingthe motion information of the selected merge candidate. The motioninformation of the selected merge candidate may be used as the motioninformation of the current block.

As another example, when the (A)MVP mode applies to the current block,the decoding apparatus may construct an (A)MVP candidate list and usethe motion vector of an mvp candidate selected from among mvp candidatesincluded in the (A)MVP candidate list as an mvp of the current block.The selection may be performed based on the above-described candidateselection information (mvp flag or mvp index). In this case, the MVD ofthe current block may be derived based on information on the MVD, andthe motion vector of the current block may be derived based on mvp andMVD of the current block. In addition, the reference picture index ofthe current block may be derived based on the reference picture indexinformation. A picture indicated by the reference picture index in thereference picture list of the current block may be derived as areference picture referenced for inter prediction of the current block.

Meanwhile, as described below, the motion information of the currentblock may be derived without candidate list construction and, in thiscase, the motion information of the current block may be derivedaccording to the disclosed procedure in the below-described predictionmode. In this case, the above-described candidate list construction maybe omitted.

The image decoding apparatus may generate prediction samples of thecurrent block based on motion information of the current block (S1730).In this case, the reference picture may be derived based on thereference picture index of the current block, and the prediction samplesof the current block may be derived using the samples of the referenceblock indicated by the motion vector of the current block on thereference picture. In this case, as described below, some cases, aprediction sample filtering procedure may be further performed withrespect to all or some of the prediction samples of the current block.

For example, the inter prediction unit of the decoding apparatus mayinclude a prediction mode determination unit, a motion informationderivation unit and a prediction sample derivation unit, and, theprediction mode determination unit may determine the prediction mode ofthe current block based on the received prediction mode information, themotion information derivation unit may derive the motion information (amotion vector and/or a reference picture index, etc.) of the currentblock based on the received motion information, and the predictionsample derivation unit may derive the prediction samples of the currentblock.

The decoding apparatus may generate residual samples of the currentblock based the received residual information (S1740). The decodingapparatus may generate the reconstructed samples of the current blockbased on the prediction samples and the residual samples and generate areconstructed picture based on this (S1750). Thereafter, an in-loopfiltering procedure is applicable to the reconstructed picture, asdescribed above.

As described above, the inter prediction procedure may include step ofdetermining an inter prediction mode, step of deriving motioninformation according to the determined prediction mode, and step ofperforming prediction (generating prediction samples) based on thederived motion information. The inter prediction procedure may beperformed by the encoding apparatus and the decoding apparatus, asdescribed above.

Prediction Sample Generation

Based on motion information derived according to a prediction mode, apredicted block for a current block may be derived. The predicted blockmay include prediction samples (prediction sample array) of the currentblock. When a motion vector of the current block specifies a fractionalsample unit, an interpolation procedure may be performed, and, throughthis, based on reference samples of a fractional sample unit within areference picture, the prediction samples of the current block may bederived. When affine inter prediction applies to the current block, theprediction samples may be generated based on a sample/subblock unit MV.When applying bi-prediction, prediction samples derived through aweighted sum or a weighted average (according to the phase) of theprediction samples derived based on L0 prediction (e.g., predictionusing a reference picture and MVL0 in a reference picture list L0) andprediction samples derived based on L1 prediction (e.g., predictionusing a reference picture and MVL1 in a reference picture list L1) maybe used as the prediction samples of the current block. When applyingbi-prediction, if a reference picture used for L0 prediction and areference picture used for L1 prediction are located in differenttemporal directions based on a current picture (e.g., in case ofbi-prediction and bidirectional prediction), this may be referred to astrue bi-prediction.

Reconstructed samples and a reconstructed picture may be generated basedon the derived prediction samples and, thereafter, a procedure such asin-loop filtering may be performed as described above.

Weighted Sample Prediction

In inter prediction, weighted sample prediction may be used. Weightedsample prediction may be called weighted prediction. Weighted predictionwas designed to compensate for change in illumination in a videosequence. Weighted prediction has been designed in the AVC standard, andthis feature is particularly effective in a video encoder and a videosplicing application.

For example, weighted prediction may be used as a coding tool forefficiently encoding content to which fading applies. As weightedprediction applies, weighted parameters (e.g., weight and offset) may besignaled for reference pictures belonging to reference picture lists L0and L1. Accordingly, during a motion compensation process, a weight andan offset for a corresponding reference picture is applicable.

Weighted prediction may apply when a slice type of a current slicelocated in which a current block (e.g., CU) is located is a P slice or aB slice. For example, weighted prediction may be used not only whenapplying bi-prediction but also when applying uni-prediction. Forexample, as described below, weighted prediction may be determined basedon weightedPredFlag, and the value of weightedPredFlag may be determinedbased on a signaled pps_weighted_pred_flag (in case of a P slice) orpps_weighted_bipred_flag (in case of a B slice).

For example, the value of a variable weightedPredFlag may be derived asfollows. When a parameter slice_type specifying a current slice typespecifies a P slice, the value of weightedPredFlag may be set to thesame value as pps_weighted_pred_flag. Otherwise (when the value ofslice_type specifies a B slice), the value of weightedPredFlag may beset to the same value as pps_weighted_bipred_flag.

A value of prediction sample(s) which is output of weighted predictionmay be referred to as pbSamples. A weighted prediction procedure may belargely divided into a basic weighted (sample) prediction procedure andan explicit weighted (sample) prediction procedure. In some embodiments,the weighted (sample) prediction procedure may mean only an explicitweighted (sample) prediction procedure. For example, when the value ofweightedPredFlag is 0, an array pbSamples of prediction samples may bederived according to a basic weighted sample prediction processdescribed below. Otherwise (e.g., when the value of weightedPredFlag is1), an array pbSamples of prediction sample may be derived according toan explicit weighted sample prediction process. As an embodiment, theexplicit weighted sample prediction process will be described below.

Explicit Weighted Sample Prediction Process

For explicit weighted sample prediction processing for generating anarray pbSamples having a size of (nCbW)×(nCbH) specifying predictionsamples, the following parameters may be used.

-   -   variable nCbW specifying the width of a current coding block and        variable nCbH specifying the height of the current coding block    -   arrays predSamplesL0 and predSamplesL1 having a size of        (nCbW)×(nCbH)    -   flags predFlagL0 and predFlagL1 specifying utilization of a        prediction list    -   reference indices refIdxL0 and refIdxL1    -   variable cIdx specifying a color component index    -   bitDepth specifying the bit depth of a sample

A weighted prediction process may be performed using the above variablesas follows. Hereinafter, this will be described with reference to FIG.18 . First, the value of a variable shift1 may be set to a value ofMax(2, 14−bitDepth) (S1810). Next, variables log 2Wd, o0, o1, w0 and w1may be derived as follows (S1820). When the value of cIdx is a value(e.g., 0) specifying a luma sample, it may be calculated as shown in thefollowing equation.

log 2Wd=luma_log2_weight_denom+shift1

w0=LumaWeightL0[refIdxL0]

w1=LumaWeightL1[refIdxL1]

o0=luma offset_l0[refIdxL0]<<(BitDepthY−8)

o2=luma offset_l1[refIdxL1]<<(BitDepthY−8)   [Equation 1]

Otherwise (e.g., when the value cIdx is a value (e.g., a non-zero value)specifying a chroma sample value, it may be derived as shown in thefollowing equation.

log 2Wd=ChromaLog2WeightDenom+shift1

w0=ChromaWeightL0[refIdxL0][cIdx−1]

w1=ChromaWeightL1[refIdxL1][cIdx−1]

o0=ChromaOffsetL0[refIdxL0][cIdx−1]<<(BitDepthC−8)

o1=ChromaOffsetL1[refIdxL1][cIdx−1]<<(BitDepthC−8)   [Equation 2]

Next, for x=0 . . . nCbW−1 and y=0 . . . nCbH−1, a prediction samplepbSamples[x][y] may be derived as follows (S1830).

When the value of predFlagL0 is 1 and the value of predFlagL1 is 0, thevalue of the prediction sample may be derived as follows.

if (log 2Wd>=1)

pbSamples[x][y]=Clip3(0, (1<<bitDepth)−1, ((predSamplesL0[x][y]*w0+2 log2Wd−1)>>log 2Wd)+o0)

else

pbSamples[x][y]=Clip3(0, (1<<bitDepth)−1, predSamplesL0[x][y]*w0+o0)  [Equation 3]

Otherwise, when the value of predFlagL0 is 0 and the value of predFlagL1is 1, the value of the prediction sample may be derived as shown in thefollowing Equation.

-   -   if (log 2Wd>=1)

pbSamples[x][y]=Clip3(0, (1<<bitDepth)−1, ((predSamplesL1[x][y]*w1+2 log2Wd−1)>>log 2Wd)+o1)

-   -   else

pbSamples[x][y]=Clip3(0, (1<<bitDepth)−1, predSamplesL1[x][y]*w1+o1)  [Equation 4]

Otherwise (when the value of predFlagL0 is 1 and the value of predFlagL1is 1), the value of the prediction sample may be derived as shown in thefollowing Equation.

pbSamples[x][y]=Clip3(0, (1<<bitDepth)−1,(predSamplesL0[x][y]*w0+predSamplesL1[x][y]*w1+((o0+o1+1)<<log2Wd))>>(log 2Wd+1))   [Equation 5]

Prediction Weighted Table

The above-described NAL structure is applicable to a prediction weightedtable. In addition, in order to signal the above-described weighted(sample) prediction, a prediction weighted table described below may beused.

The structure of a weighted prediction table for signaling weighted(sample) prediction may be designed similarly to the structure of aweighted prediction table of AVC or HEVC. A weighted prediction processmay be initiated by two flags signaled in an SPS.

FIG. 19 is a view illustrating syntax for two syntax elements signaledin an SPS. In the syntax shown in FIG. 19 , a syntax elementsps_weightedpred_flag may specify whether weighted prediction isapplicable to a P slice referencing the SPS. For example, a first value(e.g., 0) of sps_weighted_pred_flag may specify that weighted predictiondoes not apply to the P slice referencing the SPS. A second value(e.g., 1) of sps_weighted_pred_flag may specify that weighted predictionmay apply to the P slice referencing the SPS.

A syntax element sps_weighted_bipred_flag may specify whether explicitweighted prediction is applicable to a B slice referencing the SPS. Forexample, a first value (e.g., 0) of sps_weighted_bipred_flag may specifythat explicit weighted prediction does not apply to the B slicereferencing the SPS. A second value (e.g., 1) ofsps_weighted_bipred_flag may specify that explicit weighted predictionmay apply to the B slice referencing the SPS.

The above-described two flags may be signaled through the SPS, and mayspecify whether weighted prediction is applicable to a P and/or B slicepresent in a CVS.

FIG. 20 is a view illustrating a weighted prediction syntax elementsignaled in a PPS. A syntax element pps_weighted_pred_flag may specifywhether weighted prediction applies to a P slice referencing the PPS.For example, a first value (e.g., 0) of pps_weighted_pred_flag mayspecify that weighted prediction does not apply to the P slicereferencing the PPS. A second value (e.g., 1) of pps_weighted_pred_flagmay specify that weighted prediction applies to the P slice referencingthe PPS. Meanwhile, when the value of sps_weighted_pred_flag is a firstvalue (e.g., 0), the value of pps_weighted_pred_flag may be set to thefirst value (e.g., 0).

A syntax element pps_weighted_bipred_flag may specify whether explicitweighted prediction applies to a B slice referencing the PPS. Forexample, a first value (e.g., 0) of pps_weighted_bipred_flag may specifythat explicit weighted prediction does not apply to the B slicereferencing the PPS. A second value (e.g., 1) ofpps_weighted_bipred_flag may specify that explicit weighted predictionapplies to the B slice referencing the PPS. Meanwhile, when the value ofsps_weighted_bipred_flag is a first value (e.g., 0), the value ofpps_weighted_bipred_flag may be set to the first value (e.g., 0).

FIG. 21 is a view illustrating a weighted prediction syntax elementsignaled in a slice header. The slice header may include the followingsyntax elements. A syntax element slice_pic_parameter_set_id may specifya value of pps_pic_parameter_set_id for a currently used PPS.slice_pic_parameter_set_id may have a value of 0 to 63. Meanwhile, inorder to comply with bitstream conformance, a constraint is imposed suchthat a value of a temporal ID of a current picture is equal to orgreater than a temporal ID of a PPS having the samepps_pic_parameter_set_id as slice_pic_parameter_set_id.

A syntax element slice address may specify a slice address of a slice.When the value of slice_address is not provided, the value ofslice_address may be derived as 0.

Meanwhile, when the value of rect_slice_flag is a first value (e.g., 0),an ID of a brick may be set as the value of the slice address,slice_address may have a bit length of Ceil(Log 2(NumBricksInPic), andthe value of slice_address may have a value of 0 to NumBricksInPic-1.Here, NumBrickslnPic may specify the number of bricks with in a picture.

Meanwhile, when the value of rect_slice_flag is a second value (e.g.,1), the following process may be performed. A slice ID of a slice may beset as the value of the slice address. The length of slice_address maybe set to a bit length of signalled_slice_id_length_minus1+1.

In addition, when the value of rect_slice_flag is a second value (e.g.,1), if the value of signalled_slice_id_flag is 0, the value ofslice_address may have a value of 0 to num_slices_in_pic_minus1.Otherwise (when the value of signalled_slice_id_flag is not 0), thevalue of slice address may have a value of 0 to2^((signalled_slice_id_length_minus1+1))−1.

A syntax element num_ref_idx_active_override_flag may specify whether asyntax num_ref_idx_active_minus1[0] is provided for P and B slices andwhether a syntax element num_ref_idx_active_minus1[1] is provided for aB slice. For example, when a first value (e.g., 0) ofnum_ref_idx_active_override_flag may specify that the syntax elementsnum_ref_idx_active_minus1[0] and num_ref_idx_active_minus1[1] are notprovided. A second value (e.g., 1) of num_ref_idx_active override flagmay specify that the syntax element num_ref_idx_active_minus1[0] isprovided for the P and B slices and the syntax elementnum_ref_idx_active_minus1[1] is provided for the B slice.

Meanwhile, when the value of num_ref_idx_active_override_flag is notsignaled, the value of num_ref_idx_active_override_flag may be derivedas 1.

A syntax element num_ref_idx_active_minus1[i] may be used to derive avariable NumRefIdxActive[i]. The value of num_ref_idx_active_minus1[i]may have a value of 0 to 14.

When the current slice is a B slice, the value ofnum_ref_idx_active_override_flag is a second value (e.g., 1) and thevalue of num_ref_idx_active_minus1[i] is not provided, the value ofnum_ref_idx_active_minus1[i] may be derived as 0 (here, the value of iis 0 or 1).

When the current slice is a P slice, the value ofnum_ref_idx_active_override_flag is a second value (e.g., 1) and thevalue of num_ref_idx_active_minus1[0] is not provided, the value ofnum_ref_idx_active_minus1[0] may be derived as 0.

The value of a variable NumRefIdxActive[i] may be derived as shown inthe equation of FIG. 22 . Meanwhile, a value of NumRefIdxActive[i]−1specifying a value of a maximum reference index for a reference picturelist i may be used to decode a slice. For example, when the value ofNumRefIdxActive[i] is 0, any reference index for the reference picturelist i may not be used to decode the slice. Accordingly, when thecurrent slice is a P slice, the value of NumRefIdxActive[0] may begreater than 0. In addition, when the current slice is a B slice, thevalues of NumRefIdxActive[0] and NumRefIdxActive[1] may be greater than0.

Meanwhile, like the syntax 2110 of FIG. 21 , weighted prediction tablesyntax pred_weight_table( ) signaling a parameter for weightedprediction may be called according to the values ofpps_weighted_pred_flag and pps_weighted_bipred_flag and the value ofslice type.

FIG. 23 is a view illustrating weighted prediction table syntax calledfrom a slice header. In the syntax structure of FIG. 23 , a syntaxelement luma_log2_weight_denom may be a syntax element specifying a base2 logarithm of a denominator for a luma weighting factor. In anembodiment, luma_log2_weight_denom may be a syntax element specifying alogarithm of a denominator for all luma weighting factors. The value ofluma_log2_weight_denom may have a value of 0 to 7.

A syntax element delta_chroma_log2_weight_denom may specify a differenceof a base 2 logarithm of a denominator for a chroma weighting factor.For example, delta_chroma_log2_weight_denom may specify a difference ofa base 2 logarithm of a denominator for all chroma weighting factors.When the value of delta_chroma_log2_weight_denom is not present, thevalue thereof may be derived as 0.

The value of ChromaLog2WeightDenom may be calculated asluma_log2_weight_denom+delta_chroma_log2_weight_denom.ChromaLog2WeightDenom may have a value of 0 to 7.

A syntax element luma_weight_l0_flag[i] may specify whether weightingfactors for a luma component of list 0 prediction using RefPicList[0][i]are present. For example, a first value (e.g., 0) ofluma_weight_l0_flag[i] may specify that the weighting factors for theluma component of list 0 prediction using RefPicList[0][i] are notpresent. A second value (e.g., 1) of luma_weight_l0_flag[i] may specifythat the weighting factors for the luma component of list 0 predictionusing RefPicList[0][i] are present.

A syntax element chroma_weight_l0_flag[i] may specify presence/absenceof weighting factors for a chroma prediction value of list 0 preditionusing RefPicList[0][i]. For example, a first value (e.g., 0) ofchroma_weight_l0_flag[i] may specify that weighting factors for thechroma prediction value of list 0 predition using RefPicList[0][i] arenot present. A second value (e.g., 1) of chroma_weight_l0_flag[i] mayspecify that weighting factors for the chroma prediction value of list 0predition using RefPicList[0][i] are present. Whenchroma_weight_l0_flag[i] is not provided, the value thereof may bederived as 0.

A syntax element delta_luma_weight_l0[i] may specify a difference in aweighting factor applying to a luma prediction value for prediction oflist 0 using RefPicList[0][i].

A variable LumaWeightL0[i] may be derived as a value of(1<<luma_log2_weight_denom)+delta_luma_weight_l0[i].

When the value of luma_weight_l0 flag[i] is 1, delta_luma_weight_l0[i]may have a value of −128 to 127. When the value of lumaweight_l0_flag[i] is 0, the value of LumaWeightL0[i] may be derived as avalue of 2^(luma_log2_weight_denom).

A syntax element luma_offset_l0[i] may specify an additive offsetapplying to a luma prediction value for list 0 prediction usingRefPicList[0][i]. luma_offset_l0[i] may have a value of −128 to 127.When the value of luma_weight_l0 flag[i] is 0, the value ofluma_offset_l0[i] may be derived as 0.

A syntax element delta_chroma_weight_l0[i][j] may specify a differencein a weighting factor applying to a chroma prediction value forprediction of list 0 using RefPicList[0][i], for Cb when the value of jis 0 and Cr when the value of j is 1.

A variable ChromaWeightL0[i][j] may be derived as a value of(1<<ChromaLog2WeightDenom)+delta_chroma_weight_l0[i][j].

When the value of chroma_weight_l0_flag[i] is 1,delta_chroma_weight_l0[i][j] may have a value of −128 to 127. When thevalue of chroma_weight_l0_flag[i] is 0, the value ofChromaWeightL0[i][j] may be derived as a value of2^(ChromaLog2WeightDenom).

delta_chroma_offset_l0[i][j] may specify a difference in an additiveoffset applying to a chroma prediction value for prediction of list 0using RefPicList[0][i], for Cb when the value of j is 0 and Cr when thevalue of j is 1.

A variable ChromaOffsetL0[i][j] may be derived as shown in the followingequation.

ChromaOffsetL0[i][j]=Clip3(−128, 127,(128+delta_chroma_offset_l0[i][j]−((128*ChromaWeightL0[i][j])>>ChromaLog2WeightDenom)))  [Equation 6]

delta chroma_offset_l0[i][j] may have a value of −4*128 to 4*127.

Meanwhile, when the value of chroma_weight_l0_flag[i] is 0, the value ofChromaOffsetL0[i][j] may be derived as 0.

Redesign of Pred Weight Table Syntax

The above-described prediction weighted table may be parsed in a sliceheader. Hereinafter, an embodiment in which the prediction weightedtable is parsed in an APS will be described as an alternativeembodiment.

FIG. 24 is a view illustrating syntax in which a prediction weightedtable is signaled in an APS RBSP. As shown in FIG. 24 , a predictionweighted table may be included in the APS RBSP. For this, each APS RB SPmay be used in a decoding process before it is referenced. For example,each APS RBSP may be included in at least one access unit having atemporal ID TemporalId equal to or less than the temporal ID TemporalIdof an encoded slice NAL unit or may be provided from the outside.

For this, in an embodiment, when aspLayerId may be used as nuh_layer_idof the APS NAL unit. For example, when a layer having the same value asaspLayerId is an independent layer (e.g., when the value ofvps_independent_layer_flag[GeneralLayerIdx[aspLayerId]] is 1), the APSNAL unit including the APS RBSP shall have nuh_layer_id having the samevalue as nuh_layer_id of an encoded slice NAL unit referencing this.Otherwise, the APS NAL unit including the APS RBSP shall havenuh_layer_id having the same value as nuh_layer_id of an encoded sliceNAL unit referencing this or nuh_layer_id having the same value asnuh_layer_id of a direct dependent layer of a layer including an encodedslice NAL unit referencing this.

In addition, in an access unit, all APS NAL units havingadaptation_parameter_set_id of a specific value and aps_params_type of aspecific value shall have the same content.

Hereinafter, the syntax elements shown in FIG. 24 will be described. Asyntax element adaptation_parameter_set_id may specify an identifier foran APS. adaptation_parameter_set_id may be used as the identifier forthe APS such that another syntax element references the APS. When thevalue of aps_params_type described below is equal to LMCS_APS,adaptation_parameter_set_id may have a value of 0 to 3.

A syntax element aps_params_type may specify a type of an APS parametertransmitted using an APS as shown in the following table. For example,when the value of aps_params_type is a first value (e.g., 1), the typeof the APS may be determined to be an LMCS_APS type transmitting an LMCSparameter, and adaptation_parameter_set_id may have a value of 0 to 3.

In the same way, when the value of aps_params_type is a third value(e.g., 3), the type of the APS may be determined to be a PRED_WEIGHT_APStype transmitting prediction weighted parameters.

TABLE 2 Name of Type of APS aps_params_type aps_params_type parameters 0ALF_APS ALF parameters 1 LMCS_APS LMCS parameters 2 SCALING_APS Scalinglist parameters 3 PRED_WEIGHT_APS Prediction weighted parameters 4 . . .7 Reserved Reserved

In this case, each individual type of the APS may have an individualdata space for adaptation_parameter_set_id. In addition, an APS NAL unit(having adaptation_parameter_set_id of a specific value andaps_params_type of a specific value) may be shared between pictures. Inaddition, different slices in one picture may reference different ALFAPSs.

A syntax element aps_extension_flag may specify whetheraps_extension_data_flag syntax elements are provided in the APS RBSPsyntax structure. For example, a first value (e.g., 0) ofaps_extension_flag may specify that the aps_extension_data_flag syntaxelements are not provided in the APS RBSP syntax structure. A secondvalue (e.g., 1) of aps_extension_flag may specify that theaps_extension_data_flag syntax elements are provided in the APS RBSPsyntax structure.

aps_extension_data_flag may have any value. Presence/absence ofaps_extension_data_flag and the value of aps_extension_data_flag have noeffect on decoder conformance. For example, the decoder may ignore allaps_extension_data_flag syntax elements.

As described above, a new aps_params_type may be added to an existingtype. In addition, instead of content of pred_weight_table( ) the sliceheader may be modified as shown in FIG. 25 in order to signal an APS ID.FIG. 25 is a view illustrating syntax of a modified slice header. In thesyntax of FIG. 25 , a syntax element slice_pred_weight_aps_id mayspecify adaptation_parameter_set_id of a prediction weighted table APS.A temporal ID TemporalId of an APS NAL unit having aps_params_typehaving the same value as PRED_WEIGHT_APS and adaptation_parameter_set_idhaving the same value as slice_pred_weight_aps_id may be less than orequal to the temporal ID of an encoded slice NAL unit. Whenslice_pred_weight_aps_id is provided, the value ofslice_pred_weight_aps_id may have the same value for all slices of onepicture.

FIG. 26 is a view illustrating an example of a prediction weighted table(e.g., pred_weight_table( )) syntax. The syntax of FIG. 26 may be asyntax structure called by pred_weight_data( ) of FIG. 24 . For example,the syntax name of FIG. 26 may be modified to pred_weight_data( ) andused.

In the syntax of FIG. 26 , a syntax element num_lists_active_flag mayspecify whether prediction weighted table information is signaled withrespect to reference lists. For example, a first value (e.g., 0) ofnum_lists_active_flag may specify that prediction weighted tableinformation is not signaled with respect to all reference lists. Forexample, a first value (e.g., 0) of num_lists_active_flag may specifythat prediction weighted table information may be signaled only withrespect to reference list L0. Accordingly, only NumRefIdxActive[0]syntax element for reference list L0 may be obtained from a bitstreamaccording to the syntax structure of FIG. 26 (2610), and weightinformation of reference list L0 may be obtained from the bitstreamaccording to the value of NumRefIdxActive[0] (S 2620).

Meanwhile, a second value (e.g., 2) of num_lists_active_flag may specifythat prediction weighted table information is signaled even with respectto reference list 1. For example, a second value (e.g., 1) ofnum_lists_active_flag may specify that prediction weighted tableinformation may be signaled with respect to both reference lists L0 andL1. Accordingly, the values of NumRefIdxActive[0] and NumRefIdxActive[1]syntax elements may be obtained from the bitstream with respect toreference lists L0 and L1 according to the syntax structure of FIG. 26(2610). In addition, when the value of num_lists_active_flag is a secondvalue (e.g., 1) (2630), weight information may be obtained from abitstream with respect to reference list L1 according to the value ofNumRefIdxActive[1] (2640).

A syntax element numRefIdxActive[i] may be used to specify the number ofutilized reference indices. numRefIdxActive[i] may have a value of 0 to14.

Syntax and semantics in FIG. 26 and the description thereof may specifywhether information on at least one list is parsed in an APS when a flagnum_lists_active_flag is parsed.

Meanwhile, descriptors described in the syntax in the above descriptionmay be interpreted as having the following meaning.

-   -   ae(v): context adaptive arithmetic entropy encoding syntax        element    -   b(8): byte unit syntax element having a bit string pattern. A        syntax element according to this may be parsed as an 8-bit        value.    -   f(n): syntax element described as an n-bit fixed pattern bit        string in which a left bit has priority.    -   i(n): integer syntax element with a sign using n bits. In the        syntax table, when n is denoted by v, the number of bits        constructing the corresponding syntax element may be determined        based on a value of another syntax element.    -   se(v): integer 0-th order Exp-Golomb-coded syntax element with a        sign in which a left bit has priority. A parsing process for        this descriptor may be specified by a k value set to 0.    -   st(v): syntax element described as a bitstring terminated with a        null value, like UTF-8(UCS (universal coded character set)        transmission format-8).    -   tu(v): truncated unary syntax element    -   u(n): integer syntax element without a sign, which may be        expressed by n bits. In the syntax table, when n is denoted by        v, the value of a bit expressing the corresponding syntax        element may be determined according to a value of another syntax        element.    -   ue(v): 0-th order Exp-Golomb-coded syntax element having an        integer value without a sign in which a left bit has priority. A        parsing process for this descriptor may be specified by a k        value set to 0.

Encoding and Decoding Method

Hereinafter, an image decoding method performed by an image decodingapparatus will be described with reference to FIG. 27 . The imagedecoding apparatus according to an embodiment may include a memory and aprocessor, and the processor may perform the following operation.

First, the decoding apparatus may parse weight information specifying aweight for a reference sample from a bitstream according to a weightparameter syntax structure (S2710). For example, the decoding apparatusmay obtain syntax elements such as luma_log2_weight_denom,delta_chroma_log2 weight_denom, num_lists_active_flag,NumRefIdxActive[i], luma weight_l0_flag[i], chroma_weight_l0_flag[i],delta_luma weight_l0[i], luma_offset_l0[i], delta_chroma_weight_l0[i][j]and delta_chroma_offset_l0[i][j] for the weight based onpred_weight_table( ) syntax which is a weight parameter syntax element,as described with reference to FIG. 26 . As described above, thepred_weight_table( ) syntax may be called from a slice header or APSRBSP, as described above.

Next, the decoding apparatus may decode a current block by performinginter prediction based on weight information as described above (S2720).For example, the decoding apparatus may derive a prediction sample arraypbSamples, to which weighted prediction applies, as the above-describedexplicit weighted sample prediction process is performed based on thesyntax element obtained from the bitstream.

Meanwhile, in order to perform step S2710 of parsing the weightinformation according to the weight parameter syntax structure, thedecoding apparatus may obtain weight number information (e.g.,NumRefIdxActive[i]) specifying the number of weight information obtainedfrom the bitstream according to the weight parameter syntax structure.In addition, the decoding apparatus may obtain weight information (e.g.,luma weight_l0_flag[i], chroma_weight_l0_flag[i],delta_luma_weight_l0[i], luma_offset_l0[i],delta_chroma_weight_l0[i][j], delta_chroma_offset_l0[i][j]) from theweight parameter syntax structure based on the weight numberinformation.

Here, the weight number information may be obtained from the bitstreamaccording to the weight parameter syntax structure based on flaginformation (e.g., num_lists_active_flag) obtained from the bitstream.In addition, the flag information may specify whether the weight numberinformation is obtained from the bitstream by the weight parametersyntax structure. In addition, the weight number information may beindividually obtained for each reference picture list which may be usedto decode the current block. In addition, weight number information of areference picture list used when bidirectional reference is used todecode the current block may be determined based on a value of the flaginformation.

Meanwhile, the weight parameter syntax structure may be signaled by anetwork abstraction layer (NAL) unit signaling a parameter set. Forexample, as described above, the weight parameter syntax structure maybe signaled using an ASP NAL unit. In this case, weight information ofthe current block may be identified based on a parameter set identifierobtained from header information of a slice including the current block.Furthermore, all slices belonging to one picture may be limited to useweight information by using a parameter set identified by the sameidentifier.

Hereinafter, an image encoding method performed by an image encodingapparatus will be described with reference to FIG. 28 . The imageencoding apparatus according to an embodiment may include a memory and aprocessor, and the processor may perform operation corresponding tooperation of the decoding apparatus.

For example, the encoding apparatus may generate a prediction block of acurrent block by performing inter prediction (S2810). Next, the encodingapparatus may generate weight information specifying a weight for asample constructing the prediction block (S2820). Next, the encodingapparatus may determine weight number information specifying the numberof weight information (S2830). Next, the encoding apparatus may generatea bitstream including the weight number information and the weightinformation based on a weight parameter syntax structure (S2840).

In addition, flag information specifying whether the weight numberinformation is included in the bitstream may be further included in thebitstream. The flag information may specify whether the weight numberinformation is obtained from the bitstream by the weight parametersyntax structure.

Furthermore, the weight number information may be individually obtainedfor each reference picture list which may be used to decode a currentblock. The flag information may be used to determine whether the weightnumber information of a reference picture list used when bidirectionalreference is used to decode the current block is obtained.

Application Embodiment

While the exemplary methods of the present disclosure described aboveare represented as a series of operations for clarity of description, itis not intended to limit the order in which the steps are performed, andthe steps may be performed simultaneously or in different order asnecessary. In order to implement the method according to the presentdisclosure, the described steps may further include other steps, mayinclude remaining steps except for some of the steps, or may includeother additional steps except for some steps.

In the present disclosure, the image encoding apparatus or the imagedecoding apparatus that performs a predetermined operation (step) mayperform an operation (step) of confirming an execution condition orsituation of the corresponding operation (step). For example, if it isdescribed that predetermined operation is performed when a predeterminedcondition is satisfied, the image encoding apparatus or the imagedecoding apparatus may perform the predetermined operation afterdetermining whether the predetermined condition is satisfied.

The various embodiments of the present disclosure are not a list of allpossible combinations and are intended to describe representativeaspects of the present disclosure, and the matters described in thevarious embodiments may be applied independently or in combination oftwo or more.

Various embodiments of the present disclosure may be implemented inhardware, firmware, software, or a combination thereof In the case ofimplementing the present disclosure by hardware, the present disclosurecan be implemented with application specific integrated circuits(ASICs), Digital signal processors (DSPs), digital signal processingdevices (DSPDs), programmable logic devices (PLDs), field programmablegate arrays (FPGAs), general processors, controllers, microcontrollers,microprocessors, etc.

In addition, the image decoding apparatus and the image encodingapparatus, to which the embodiments of the present disclosure areapplied, may be included in a multimedia broadcasting transmission andreception device, a mobile communication terminal, a home cinema videodevice, a digital cinema video device, a surveillance camera, a videochat device, a real time communication device such as videocommunication, a mobile streaming device, a storage medium, a camcorder,a video on demand (VoD) service providing device, an OTT video (over thetop video) device, an Internet streaming service providing device, athree-dimensional (3D) video device, a video telephony video device, amedical video device, and the like, and may be used to process videosignals or data signals. For example, the OTT video devices may includea game console, a blu-ray player, an Internet access TV, a home theatersystem, a smartphone, a tablet PC, a digital video recorder (DVR), orthe like.

FIG. 29 is a view showing a contents streaming system, to which anembodiment of the present disclosure is applicable.

As shown in FIG. 29 , the contents streaming system, to which theembodiment of the present disclosure is applied, may largely include anencoding server, a streaming server, a web server, a media storage, auser device, and a multimedia input device.

The encoding server compresses contents input from multimedia inputdevices such as a smartphone, a camera, a camcorder, etc. into digitaldata to generate a bitstream and transmits the bitstream to thestreaming server. As another example, when the multimedia input devicessuch as smartphones, cameras, camcorders, etc. directly generate abitstream, the encoding server may be omitted.

The bitstream may be generated by an image encoding method or an imageencoding apparatus, to which the embodiment of the present disclosure isapplied, and the streaming server may temporarily store the bitstream inthe process of transmitting or receiving the bitstream.

The streaming server transmits the multimedia data to the user devicebased on a user's request through the web server, and the web serverserves as a medium for informing the user of a service. When the userrequests a desired service from the web server, the web server maydeliver it to a streaming server, and the streaming server may transmitmultimedia data to the user. In this case, the contents streaming systemmay include a separate control server. In this case, the control serverserves to control a command/response between devices in the contentsstreaming system.

The streaming server may receive contents from a media storage and/or anencoding server. For example, when the contents are received from theencoding server, the contents may be received in real time. In thiscase, in order to provide a smooth streaming service, the streamingserver may store the bitstream for a predetermined time.

Examples of the user device may include a mobile phone, a smartphone, alaptop computer, a digital broadcasting terminal, a personal digitalassistant (PDA), a portable multimedia player (PMP), navigation, a slatePC, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smartglasses, head mounted displays), digital TVs, desktops computer, digitalsignage, and the like.

Each server in the contents streaming system may be operated as adistributed server, in which case data received from each server may bedistributed.

The scope of the disclosure includes software or machine-executablecommands (e.g., an operating system, an application, firmware, aprogram, etc.) for enabling operations according to the methods ofvarious embodiments to be executed on an apparatus or a computer, anon-transitory computer-readable medium having such software or commandsstored thereon and executable on the apparatus or the computer.

INDUSTRIAL APPLICABILITY

The embodiments of the present disclosure may be used to encode ordecode an image.

1. An image decoding method performed by an image decoding apparatus,the image decoding method comprising: parsing weight informationspecifying a weight for a reference sample from a bitstream according toa weight parameter syntax structure; and decoding a current block byperforming inter prediction based on the weight information, wherein thedecoding the current block comprises: deriving a prediction block of thecurrent block based on the weight information; and decoding the currentblock based on a residual block of the current block and the predictionblock, wherein the parsing according to the weight parameter syntaxstructure comprises: obtaining weight number information specifying anumber of weight information obtained from the bitstream according tothe weight parameter syntax structure; and obtaining the weightinformation from the weight parameter syntax structure based on theweight number information, wherein the weight for the reference samplespecifies a difference in a weighting factor applying to the referencesample, wherein the weight number information is obtained from thebitstream according to the weight parameter syntax structure based onflag information obtained from the bitstream, wherein the flaginformation specifies whether the weight number information is obtainedfrom the bitstream by the weight parameter syntax structure.
 2. Theimage decoding method of claim 1, wherein the weight number informationis individually obtained for a reference picture list usable to decodethe current block.
 3. The image decoding method of claim 2, whereinweight number information of a reference picture list used whenbidirectional reference is used to decode the current block isdetermined based on a value of the flag information.
 4. The imagedecoding method of claim 1, wherein the weight parameter syntaxstructure is signaled by a network abstraction layer (NAL) unitsignaling a parameter set.
 5. The image decoding method of claim 4,wherein the weight information of the current block is identified basedon a parameter set identifier obtained from header information of aslice including the current block.
 6. The image decoding method of claim5, wherein all slices belonging to one picture uses the weightinformation by using a parameter set identified by the same identifier.7. An image encoding method performed by an image encoding apparatus,the image encoding method comprising: generating a prediction block of acurrent block by performing inter prediction; and generating a residualblock of the current block based on the prediction block, wherein weightinformation specifying a weight for a sample constructing the predictionblock is generated, wherein weight number information specifying anumber of weight information is determined, wherein a bitstreamincluding the weight number information and the weight information basedon a weight parameter syntax structure is generated, wherein the weightfor the sample specifies a difference in a weighting factor applying tothe sample, wherein the weight number information is included in thebitstream based on flag information included in the bitstream, andwherein the flag information specifies whether the weight numberinformation is obtained from the bitstream by the weight parametersyntax structure.
 8. The image encoding method of claim 7, wherein theweight number information is individually obtained for a referencepicture list usable to decode the current block.
 9. The image encodingmethod of claim 8, wherein the flag information is used to determinewhether weight number information of a reference picture list used whenbidirectional reference is used to decode the current block is obtained.10. A method of transmitting a bitstream generated by an image encodingmethod, the image encoding method comprising: generating a predictionblock of a current block by performing inter prediction; and generatinga residual block of the current block based on the prediction block,wherein weight information specifying a weight for a sample constructingthe prediction block is generated, wherein weight number informationspecifying a number of weight information is determined, wherein abitstream including the weight number information and the weightinformation based on a weight parameter syntax structure is generated,wherein the weight for the sample specifies a difference in a weightingfactor applying to the sample, wherein the weight number information isincluded in the bitstream based on flag information included in thebitstream, and wherein the flag information specifies whether the weightnumber information is obtained from the bitstream by the weightparameter syntax structure.
 11. A non-transitory computer-readablerecording medium storing a bitstream generated by the image encodingmethod of claim 7.